Rev 6032: Merge bzr/2.4 at 6027 to resolve release-notes conflict. in http://bazaar.launchpad.net/~jameinel/bzr/2.4-tag-fetch-flag-771184

John Arbash Meinel john at arbash-meinel.com
Wed Aug 10 07:38:36 UTC 2011


At http://bazaar.launchpad.net/~jameinel/bzr/2.4-tag-fetch-flag-771184

------------------------------------------------------------
revno: 6032 [merge]
revision-id: john at arbash-meinel.com-20110810073828-vcxd4knnmeec0lc1
parent: john at arbash-meinel.com-20110810073003-8e8r9quptbpcrmaa
parent: pqm at pqm.ubuntu.com-20110809201657-03q8kptf7tn1c9mw
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.4-tag-fetch-flag-771184
timestamp: Wed 2011-08-10 09:38:28 +0200
message:
  Merge bzr/2.4 at 6027 to resolve release-notes conflict.
modified:
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
  doc/en/release-notes/bzr-2.4.txt bzr2.4.txt-20110114053217-k7ym9jfz243fddjm-1
-------------- next part --------------
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2011-07-27 05:05:15 +0000
+++ b/bzrlib/tests/__init__.py	2011-08-09 09:11:17 +0000
@@ -386,9 +386,18 @@
         getDetails = getattr(test, "getDetails", None)
         if getDetails is not None:
             getDetails().clear()
+        # Clear _type_equality_funcs to try to stop TestCase instances
+        # from wasting memory. 'clear' is not available in all Python
+        # versions (bug 809048)
         type_equality_funcs = getattr(test, "_type_equality_funcs", None)
         if type_equality_funcs is not None:
-            type_equality_funcs.clear()
+            tef_clear = getattr(type_equality_funcs, "clear", None)
+            if tef_clear is None:
+                tef_instance_dict = getattr(type_equality_funcs, "__dict__", None)
+                if tef_instance_dict is not None:
+                    tef_clear = tef_instance_dict.clear
+            if tef_clear is not None:
+                tef_clear()
         self._traceback_from_test = None
 
     def startTests(self):

=== modified file 'doc/en/release-notes/bzr-2.4.txt'
--- a/doc/en/release-notes/bzr-2.4.txt	2011-08-10 07:30:03 +0000
+++ b/doc/en/release-notes/bzr-2.4.txt	2011-08-10 07:38:28 +0000
@@ -56,6 +56,10 @@
 
   (John Arbash Meinel, #609187, #812928)
 
+* Cope with not all Python versions having a ``clear`` method on
+  ``TestCase._type_equality_funcs``.
+  (Martin [gz], Jelmer Vernooij, #809048)
+
 * Fetching tags when fetching the tip revision of a branch is now
   controlled by the config setting ``branch.fetch_tags``. The behavior has
   been reverted to 2.3's not-fetching tagged revisions by default.



More information about the bazaar-commits mailing list