/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2011-08-09 09:11:17 UTC
  • mto: (6015.9.6 2.4)
  • mto: This revision was merged to the branch mainline in revision 6066.
  • Revision ID: jelmer@samba.org-20110809091117-wejv7gvu0wsa7dk8
Add python2.7 workaround for bug 809048.

Show diffs side-by-side

added added

removed removed

Lines of Context:
386
386
        getDetails = getattr(test, "getDetails", None)
387
387
        if getDetails is not None:
388
388
            getDetails().clear()
 
389
        # Clear _type_equality_funcs to try to stop TestCase instances
 
390
        # from wasting memory. 'clear' is not available in all Python
 
391
        # versions (bug 809048)
389
392
        type_equality_funcs = getattr(test, "_type_equality_funcs", None)
390
393
        if type_equality_funcs is not None:
391
 
            type_equality_funcs.clear()
 
394
            tef_clear = getattr(type_equality_funcs, "clear", None)
 
395
            if tef_clear is None:
 
396
                tef_instance_dict = getattr(type_equality_funcs, "__dict__", None)
 
397
                if tef_instance_dict is not None:
 
398
                    tef_clear = tef_instance_dict.clear
 
399
            if tef_clear is not None:
 
400
                tef_clear()
392
401
        self._traceback_from_test = None
393
402
 
394
403
    def startTests(self):