mirror of https://github.com/tqdm/tqdm.git
parent
140c94855b
commit
b6326c27ed
|
@ -45,10 +45,15 @@ class TMonitor(Thread):
|
||||||
return self.report()
|
return self.report()
|
||||||
|
|
||||||
def get_instances(self):
|
def get_instances(self):
|
||||||
# returns a copy of started `tqdm_cls` instances
|
"""returns a copy of started `tqdm_cls` instances"""
|
||||||
|
for _ in range(3): # retry
|
||||||
|
try:
|
||||||
return [i for i in self.tqdm_cls._instances.copy()
|
return [i for i in self.tqdm_cls._instances.copy()
|
||||||
# Avoid race by checking that the instance started
|
# Avoid race by checking that the instance started
|
||||||
if hasattr(i, 'start_t')]
|
if hasattr(i, 'start_t')]
|
||||||
|
except RuntimeError:
|
||||||
|
pass
|
||||||
|
return []
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
cur_t = self._time()
|
cur_t = self._time()
|
||||||
|
|
Loading…
Reference in New Issue