]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Assign closed handles to None to make errors more obvious if they are used.
authorBrian Quinlan <brian@sweetapp.com>
Sat, 25 Dec 2010 00:18:27 +0000 (00:18 +0000)
committerBrian Quinlan <brian@sweetapp.com>
Sat, 25 Dec 2010 00:18:27 +0000 (00:18 +0000)
Lib/test/test_concurrent_futures.py

index 7baf0a275a71f061a2c96c0ca6a19b90f2c05cba..876d99407156dc0031f5a3c045512f514f788f00 100644 (file)
@@ -125,6 +125,8 @@ class Call(object):
         if sys.platform.startswith('win'):
             ctypes.windll.kernel32.CloseHandle(self._called_event)
             ctypes.windll.kernel32.CloseHandle(self._can_finish)
+            self._called_event = None
+            self._can_finish = None
         else:
             del self.CALL_LOCKS[self._called_event]
             del self.CALL_LOCKS[self._can_finish]
@@ -375,8 +377,6 @@ class WaitTests(unittest.TestCase):
 
             self.assertEqual(set([future1, future2]), finished)
             self.assertEqual(set(), pending)
-
-
         finally:
             call1.close()
             call2.close()