Closes the handle to the module. @note: Normally you don't need to call this method. All handles created by I{WinAppDbg} are automatically closed when the garbage collector claims them. So unless you've been tinkering with it, setting L{hFile} to
(self)
| 404 | self.hFile = hFile |
| 405 | |
| 406 | def close_handle(self): |
| 407 | """ |
| 408 | Closes the handle to the module. |
| 409 | |
| 410 | @note: Normally you don't need to call this method. All handles |
| 411 | created by I{WinAppDbg} are automatically closed when the garbage |
| 412 | collector claims them. So unless you've been tinkering with it, |
| 413 | setting L{hFile} to C{None} should be enough. |
| 414 | """ |
| 415 | try: |
| 416 | if hasattr(self.hFile, "close"): |
| 417 | self.hFile.close() |
| 418 | elif self.hFile not in (None, win32.INVALID_HANDLE_VALUE): |
| 419 | win32.CloseHandle(self.hFile) |
| 420 | finally: |
| 421 | self.hFile = None |
| 422 | |
| 423 | def get_handle(self): |
| 424 | """ |
no test coverage detected