diff win32.py @ 131:7923faf392fe

win32.Handle.__del__ no longer raises if __init__ gets wrong arguments
author Oleg Oshmyan <chortos@inbox.lv>
date Thu, 19 May 2011 02:24:59 +0100
parents 42c8f5c152a5
children e84f33a60a5c
line wrap: on
line diff
--- a/win32.py	Thu May 19 02:21:33 2011 +0100
+++ b/win32.py	Thu May 19 02:24:59 2011 +0100
@@ -143,7 +143,7 @@
 	
 	# This is also __del__, so only locals are accessed
 	def Close(self, _CloseHandle=windll.kernel32.CloseHandle, _HANDLE=HANDLE):
-		if self.handle:
+		if getattr(self, 'handle', None):
 			_CloseHandle(_HANDLE(self.handle))
 			self.handle = None
 	__del__ = Close