Skip to content

Commit

Permalink
fix run_executor.py for Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Sep 19, 2023
1 parent 291a744 commit 5b977ff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nicegui/run_executor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
import sys
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
from functools import partial
from typing import Any, Callable
Expand Down Expand Up @@ -35,5 +36,6 @@ def tear_down() -> None:
return
for p in process_pool._processes.values(): # pylint: disable=protected-access
p.kill()
process_pool.shutdown(wait=True, cancel_futures=True)
thread_pool.shutdown(wait=False, cancel_futures=True)
kwargs = {'cancel_futures': True} if sys.version_info >= (3, 9) else {}
process_pool.shutdown(wait=True, **kwargs)
thread_pool.shutdown(wait=False, **kwargs)

0 comments on commit 5b977ff

Please sign in to comment.