diff --git a/trains/utilities/async_manager.py b/trains/utilities/async_manager.py index cd0efdc1..45732d67 100644 --- a/trains/utilities/async_manager.py +++ b/trains/utilities/async_manager.py @@ -1,5 +1,7 @@ -from threading import Lock import time +from threading import Lock + +import six class AsyncManagerMixin(object): @@ -36,7 +38,12 @@ class AsyncManagerMixin(object): if r.ready(): continue t = time.time() - r.wait(timeout=remaining) + # bugfix for python2.7 threading issues + if six.PY2 and not remaining: + while not r.ready(): + r.wait(timeout=2.) + else: + r.wait(timeout=remaining) count += 1 if max_num_uploads is not None and max_num_uploads - count <= 0: break