Skip to content
Snippets Groups Projects
Commit e7ba37ec authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Hacky workaround python bug - daemon threads continue to run after

threading module has been destroyed.
parent 2d9fcb18
No related branches found
No related tags found
No related merge requests found
......@@ -150,14 +150,25 @@ class ClearThread(threading.Thread):
(via a call to :func:`clearStatus`).
"""
while True:
# http://bugs.python.org/issue14623
#
# When the main thread exits, daemon threads will
# continue to run after the threading module is
# destroyed. Calls to the Event methods can thus
# result in errors.
try:
self.__vetoEvent .clear()
self.__clearEvent.wait()
self.__clearEvent.clear()
while True:
if not self.__clearEvent.wait(self.__timeout) and \
not self.__vetoEvent.isSet():
log.debug('Timeout - clearing status')
clearStatus()
self.__vetoEvent .clear()
self.__clearEvent.wait()
self.__clearEvent.clear()
if not self.__clearEvent.wait(self.__timeout) and \
not self.__vetoEvent.isSet():
log.debug('Timeout - clearing status')
clearStatus()
except:
pass
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment