changeset 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 652028850ea4
children cdd0f970d112
files win32.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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