From: gregor herrmann Date: Fri, 1 Apr 2022 23:33:30 +0000 (+0200) Subject: log_mhz19.py: fix deprecation warning with python 3.10 X-Git-Url: https://git.toastfreeware.priv.at/toast/airingbutler.git/commitdiff_plain/542c509c47cdae3a08d4217940c6cfb2ccfcd0fc?ds=sidebyside;hp=0e9942da8b59573f7f0b99cd3a5a4e0ee790afa0 log_mhz19.py: fix deprecation warning with python 3.10 for further reading and alternative solutions: DeprecationWarning: There is no current event loop --- 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()