def terminate(self):
try:
if self._thread:
self._thread.raiseExc(threading.ThreadError)
except (threading.ThreadError, TypeError, ValueError, SystemError):
pass
self._thread = None