parent
93d69e84f2
commit
a392f0f4f6
@ -0,0 +1,44 @@
|
|||||||
|
From fd88080637e019fdca3e9412e470b073d4f282b1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com>
|
||||||
|
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
|
||||||
|
|
Loading…
Reference in new issue