def _getInvalidHandleException(self): try: win32api.CloseHandle(1) except win32api.error, exc: return exc self.fail("Didn't get invalid-handle exception.")