Assign closed handles to None to make errors more obvious if they are used.

This commit is contained in:
Brian Quinlan 2010-12-25 00:18:27 +00:00
parent a3015a6a82
commit 291151b7f4
1 changed files with 2 additions and 2 deletions

View 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()