Merge pull request #283 from cjmayo/python3_32

{python3_32} fixes for Python 3 + Travis test: fix threads
This commit is contained in:
anarcat 2019-09-11 09:47:44 -04:00 committed by GitHub
commit dbbb64cd90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,12 +27,12 @@ class StoppableThread (threading.Thread):
def __init__ (self):
"""Store stop event."""
super(StoppableThread, self).__init__()
self._stop = threading.Event()
self._stopper = threading.Event()
def stop (self):
"""Set stop event."""
self._stop.set()
self._stopper.set()
def stopped (self, timeout=None):
"""Return True if stop event is set."""
return self._stop.wait(timeout)
return self._stopper.wait(timeout)