2022-12-12 13:45:54 +01:00
|
|
|
Index: jupyter_client-7.3.4/jupyter_client/utils.py
|
|
|
|
===================================================================
|
|
|
|
--- jupyter_client-7.3.4.orig/jupyter_client/utils.py
|
|
|
|
+++ jupyter_client-7.3.4/jupyter_client/utils.py
|
2022-12-12 17:32:44 +01:00
|
|
|
@@ -6,6 +6,7 @@ utils:
|
|
|
|
import asyncio
|
|
|
|
import inspect
|
|
|
|
import os
|
|
|
|
+import sys
|
|
|
|
|
|
|
|
|
|
|
|
def run_sync(coro):
|
|
|
|
@@ -13,10 +14,14 @@ def run_sync(coro):
|
2022-12-12 13:45:54 +01:00
|
|
|
try:
|
|
|
|
loop = asyncio.get_running_loop()
|
|
|
|
except RuntimeError:
|
|
|
|
- # Workaround for bugs.python.org/issue39529.
|
|
|
|
- try:
|
|
|
|
- loop = asyncio.get_event_loop_policy().get_event_loop()
|
|
|
|
- except RuntimeError:
|
2022-12-12 17:32:44 +01:00
|
|
|
+ if sys.version_info <= (3, 10, 8):
|
|
|
|
+ # Workaround for bugs.python.org/issue39529.
|
|
|
|
+ try:
|
|
|
|
+ loop = asyncio.get_event_loop_policy().get_event_loop()
|
|
|
|
+ except RuntimeError:
|
|
|
|
+ loop = asyncio.new_event_loop()
|
|
|
|
+ asyncio.set_event_loop(loop)
|
|
|
|
+ else:
|
|
|
|
loop = asyncio.new_event_loop()
|
|
|
|
asyncio.set_event_loop(loop)
|
2022-12-12 13:45:54 +01:00
|
|
|
import nest_asyncio # type: ignore
|