diff --git a/py3109-compat.patch b/py3109-compat.patch new file mode 100644 index 0000000..34f81ac --- /dev/null +++ b/py3109-compat.patch @@ -0,0 +1,31 @@ +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 +@@ -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: + 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: ++ 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) + import nest_asyncio # type: ignore diff --git a/python-jupyter-client.changes b/python-jupyter-client.changes index 7055a51..76fa720 100644 --- a/python-jupyter-client.changes +++ b/python-jupyter-client.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Mon Dec 12 16:30:43 UTC 2022 - Daniel Garcia + +- Update py3109-compat.patch to work with python 3.10.8 and lower. + +------------------------------------------------------------------- +Mon Dec 12 12:34:49 UTC 2022 - Daniel Garcia + +- Add py3109-compat.patch to make it work with python 3.10.9. + ------------------------------------------------------------------- Tue Jun 28 18:51:36 UTC 2022 - Ben Greiner diff --git a/python-jupyter-client.spec b/python-jupyter-client.spec index 8ceffc7..bfd662b 100644 --- a/python-jupyter-client.spec +++ b/python-jupyter-client.spec @@ -34,6 +34,8 @@ License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/jupyter/jupyter_client Source: https://files.pythonhosted.org/packages/source/j/jupyter_client/jupyter_client-%{version}.tar.gz +# PATCH-FIX-OPENSUSE py3109-compat.patch +Patch0: py3109-compat.patch BuildRequires: %{python_module hatchling} BuildRequires: %{python_module pip} BuildRequires: fdupes