- Update py3109-compat.patch to work with python 3.10.8 and lower.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-jupyter-client?expand=0&rev=29
This commit is contained in:
parent
b5a214fd31
commit
de91cbde6a
@ -2,7 +2,15 @@ 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.orig/jupyter_client/utils.py
|
||||||
+++ jupyter_client-7.3.4/jupyter_client/utils.py
|
+++ jupyter_client-7.3.4/jupyter_client/utils.py
|
||||||
@@ -13,12 +13,8 @@ def run_sync(coro):
|
@@ -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):
|
||||||
try:
|
try:
|
||||||
loop = asyncio.get_running_loop()
|
loop = asyncio.get_running_loop()
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
@ -10,10 +18,14 @@ Index: jupyter_client-7.3.4/jupyter_client/utils.py
|
|||||||
- try:
|
- try:
|
||||||
- loop = asyncio.get_event_loop_policy().get_event_loop()
|
- loop = asyncio.get_event_loop_policy().get_event_loop()
|
||||||
- except RuntimeError:
|
- except RuntimeError:
|
||||||
- loop = asyncio.new_event_loop()
|
+ if sys.version_info <= (3, 10, 8):
|
||||||
- asyncio.set_event_loop(loop)
|
+ # Workaround for bugs.python.org/issue39529.
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_event_loop_policy().get_event_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
+ loop = asyncio.new_event_loop()
|
+ loop = asyncio.new_event_loop()
|
||||||
+ asyncio.set_event_loop(loop)
|
+ asyncio.set_event_loop(loop)
|
||||||
|
+ else:
|
||||||
|
loop = asyncio.new_event_loop()
|
||||||
|
asyncio.set_event_loop(loop)
|
||||||
import nest_asyncio # type: ignore
|
import nest_asyncio # type: ignore
|
||||||
|
|
||||||
nest_asyncio.apply(loop)
|
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Dec 12 16:30:43 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
|
||||||
|
|
||||||
|
- Update py3109-compat.patch to work with python 3.10.8 and lower.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Dec 12 12:34:49 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
|
Mon Dec 12 12:34:49 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user