]> granicus.if.org Git - python/commitdiff
fix possible error
authorBenjamin Peterson <benjamin@python.org>
Tue, 19 Aug 2008 14:32:56 +0000 (14:32 +0000)
committerBenjamin Peterson <benjamin@python.org>
Tue, 19 Aug 2008 14:32:56 +0000 (14:32 +0000)
Lib/test/test_threading.py

index d0316073cb55bbfaadddeed85ed94699c4b6e3d5..c6a5cf49d2a1e47c86b4c4dda3256df8db8c9bbb 100644 (file)
@@ -329,7 +329,10 @@ class ThreadTests(unittest.TestCase):
 
         t = threading.Thread()
         with catch_warning() as w:
-            del threading.__warningregistry__
+            try:
+                del threading.__warningregistry__
+            except AttributeError:
+                pass
             msg = "isDaemon() is deprecated in favor of the " \
                   "Thread.daemon property"
             check(t.isDaemon(), w, msg)