From 542c509c47cdae3a08d4217940c6cfb2ccfcd0fc Mon Sep 17 00:00:00 2001 From: gregor herrmann Date: Sat, 2 Apr 2022 01:33:30 +0200 Subject: [PATCH 1/1] log_mhz19.py: fix deprecation warning with python 3.10 for further reading and alternative solutions: DeprecationWarning: There is no current event loop --- log_mhz19.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log_mhz19.py b/log_mhz19.py index e99ceae..7dea051 100755 --- a/log_mhz19.py +++ b/log_mhz19.py @@ -40,7 +40,7 @@ def main(): parser.add_argument('--device', '-d', default='/dev/ttyACM0', help='Device where Arduino is connected to') args = parser.parse_args() logging.basicConfig(level=logging.INFO, format='%(asctime)-15s %(message)s') - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() coro = serial_asyncio.create_serial_connection(loop, Receiver, args.device, baudrate=115200) loop.run_until_complete(coro) loop.run_forever() -- 2.39.5