Revision: 7b7dff779509 Author: Mikko Korpela <[email protected]> Date: Wed Jun 15 12:45:57 2011 Log: robotthread: Use thread.join instead of Event.wait
Update Issue 871 Status: Started http://code.google.com/p/robotframework/source/detail?r=7b7dff779509 Modified: /src/robot/utils/robotthread.py ======================================= --- /src/robot/utils/robotthread.py Sun Feb 6 01:24:10 2011 +++ /src/robot/utils/robotthread.py Wed Jun 15 12:45:57 2011 @@ -26,18 +26,18 @@ def __init__(self, runnable, args=None, kwargs=None, notifier=None): self._runnable = lambda: runnable(*(args or ()), **(kwargs or {})) - self._notifier = Event() self._result = None self._error = None self._traceback = None self._thread = None + self._exception_occurred = False def run(self): try: self._result = self._runnable() except: + self._exception_occurred = True self._error, self._traceback = sys.exc_info()[1:] - self._notifier.set() __call__ = run @@ -45,8 +45,8 @@ self._thread = Thread(self) self._thread.setDaemon(True) self._thread.start() - self._notifier.wait(timeout) - return self._notifier.isSet() + self._thread.join(timeout) + return not self._thread.isAlive() and not self._exception_occurred def get_result(self): if self._error:
