Mercurial > ~astiob > upreckon > hgweb
comparison 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 |
comparison
equal
deleted
inserted
replaced
130:652028850ea4 | 131:7923faf392fe |
---|---|
141 self.handle = None | 141 self.handle = None |
142 return handle | 142 return handle |
143 | 143 |
144 # This is also __del__, so only locals are accessed | 144 # This is also __del__, so only locals are accessed |
145 def Close(self, _CloseHandle=windll.kernel32.CloseHandle, _HANDLE=HANDLE): | 145 def Close(self, _CloseHandle=windll.kernel32.CloseHandle, _HANDLE=HANDLE): |
146 if self.handle: | 146 if getattr(self, 'handle', None): |
147 _CloseHandle(_HANDLE(self.handle)) | 147 _CloseHandle(_HANDLE(self.handle)) |
148 self.handle = None | 148 self.handle = None |
149 __del__ = Close | 149 __del__ = Close |
150 | 150 |
151 CHAR = c_char | 151 CHAR = c_char |