Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

Commit c4b8289

Browse files
committed
Fix patching an already running Proactor loop, fixes #87
1 parent d5a13b0 commit c4b8289

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nest_asyncio.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def _check_running(self):
188188
cls._run_once = _run_once
189189
cls._check_running = _check_running
190190
cls._check_runnung = _check_running # typo in Python 3.7 source
191-
cls._num_runs_pending = 0
191+
cls._num_runs_pending = 1 if loop.is_running() else 0
192192
cls._is_proactorloop = (
193193
os.name == 'nt' and issubclass(cls, asyncio.ProactorEventLoop))
194194
if sys.version_info < (3, 7, 0):

0 commit comments

Comments
 (0)