Skip to content
Snippets Groups Projects
Commit 43fb703c authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

fix pylint issues

parent 8d65dc7e
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,17 @@ def _while_sync_threadpool(tpe, max_wait, measurement, futures): ...@@ -19,6 +19,17 @@ def _while_sync_threadpool(tpe, max_wait, measurement, futures):
time.sleep(0.5) time.sleep(0.5)
def _max_wait_atm_n(measurement, max_wait, atm_n):
while measurement() < max_wait:
try:
atm_n.wait_until_equal(0, 1)
break
except WouldWaitMore:
continue
else:
raise WouldWaitMore('timeout exceeded')
def sync_threadpool(tpe: tp.Union[ExecutorWrapper, ThreadPoolExecutor], def sync_threadpool(tpe: tp.Union[ExecutorWrapper, ThreadPoolExecutor],
max_wait: tp.Optional[float] = None) -> None: max_wait: tp.Optional[float] = None) -> None:
""" """
...@@ -54,13 +65,6 @@ def sync_threadpool(tpe: tp.Union[ExecutorWrapper, ThreadPoolExecutor], ...@@ -54,13 +65,6 @@ def sync_threadpool(tpe: tp.Union[ExecutorWrapper, ThreadPoolExecutor],
if max_wait is None: if max_wait is None:
atm_n.wait_until_equal(0) atm_n.wait_until_equal(0)
else: else:
while measurement() < max_wait: _max_wait_atm_n(measurement, max_wait, atm_n)
try:
atm_n.wait_until_equal(0, 1)
break
except WouldWaitMore:
continue
else:
raise WouldWaitMore('timeout exceeded')
cond.notify_all() cond.notify_all()
wait(futures) wait(futures)
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