From a392f0f4f6de8c3c2d15787c5eb1bf1ce5d91cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Mon, 14 Jun 2021 19:55:19 +0200 Subject: [PATCH] Add patch to fix FTBFS with Python 3.10 --- ...lete-get_event_loop-with-get_running.patch | 44 +++++++++++++++++++ lirc.spec | 1 + 2 files changed, 45 insertions(+) create mode 100644 0001-Replace-the-obsolete-get_event_loop-with-get_running.patch diff --git a/0001-Replace-the-obsolete-get_event_loop-with-get_running.patch b/0001-Replace-the-obsolete-get_event_loop-with-get_running.patch new file mode 100644 index 0000000..1133703 --- /dev/null +++ b/0001-Replace-the-obsolete-get_event_loop-with-get_running.patch @@ -0,0 +1,44 @@ +From fd88080637e019fdca3e9412e470b073d4f282b1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= +Date: Mon, 14 Jun 2021 19:49:22 +0200 +Subject: [PATCH] Replace the obsolete get_event_loop with get_running_loop + +--- + python-pkg/lirc/async_client.py | 2 +- + python-pkg/tests/test_client.py | 7 ++++++- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/python-pkg/lirc/async_client.py b/python-pkg/lirc/async_client.py +index 1affce68..f3586b0f 100644 +--- a/python-pkg/lirc/async_client.py ++++ b/python-pkg/lirc/async_client.py +@@ -63,7 +63,7 @@ class AsyncConnection(object): + + self._conn = connection + self._loop = loop +- self._queue = asyncio.Queue(loop=self._loop) ++ self._queue = asyncio.Queue() + self._loop.add_reader(self._conn.fileno(), read_from_fd) + + def close(self): +diff --git a/python-pkg/tests/test_client.py b/python-pkg/tests/test_client.py +index d9af254d..7c1fb9fa 100644 +--- a/python-pkg/tests/test_client.py ++++ b/python-pkg/tests/test_client.py +@@ -106,7 +106,12 @@ class ReceiveTests(unittest.TestCase): + stdout = subprocess.PIPE, + stderr = subprocess.STDOUT) as child: + _wait_for_socket() +- loop = asyncio.get_event_loop() ++ ++ try: ++ loop = asyncio.get_running_loop() ++ except RuntimeError: ++ loop = asyncio.new_event_loop() ++ + with LircdConnection('foo', + socket_path=_SOCKET, + lircrc_path='lircrc.conf') as conn: +-- +2.31.1 + diff --git a/lirc.spec b/lirc.spec index 8fa9cb2..12cdd70 100644 --- a/lirc.spec +++ b/lirc.spec @@ -26,6 +26,7 @@ Patch2: 0002-lirc-setup-Fix-crash-on-start-on-missing-lirc.config.patch Patch3: 0003-plugins-devinput-fix-glob-no-match-error.patch Patch5: 0005-mode2-Fix-inconsistent-loglevel-debug-option-307.patch Patch6: 0006-python-pkg-Don-t-use-deprecated-time.clock-RHBZ-1718.patch +Patch7: 0001-Replace-the-obsolete-get_event_loop-with-get_running.patch BuildRequires: gcc-c++