[Python-checkins] cpython: #12788: fix error in test_policy when run under refleak detection

r.david.murray python-checkins at python.org
Sat Mar 17 02:40:22 CET 2012


http://hg.python.org/cpython/rev/474338602bd8
changeset:   75762:474338602bd8
user:        R David Murray <rdmurray at bitdance.com>
date:        Fri Mar 16 21:39:57 2012 -0400
summary:
  #12788: fix error in test_policy when run under refleak detection

files:
  Lib/test/test_email/test_policy.py |  4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_email/test_policy.py b/Lib/test/test_email/test_policy.py
--- a/Lib/test/test_email/test_policy.py
+++ b/Lib/test/test_email/test_policy.py
@@ -118,7 +118,9 @@
         self.assertEqual(foo.defects, [defect1, defect2])
 
     class MyPolicy(email.policy.Policy):
-        defects = []
+        defects = None
+        def __init__(self, *args, **kw):
+            super().__init__(*args, defects=[], **kw)
         def register_defect(self, obj, defect):
             self.defects.append(defect)
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list