From 6d7cb4930b4aa0c6713f06e5983d003deb9acd70 Mon Sep 17 00:00:00 2001 From: Tom Rathborne Date: Thu, 3 Feb 2022 09:54:22 +0100 Subject: [PATCH] Fix asyncio.run problem nvchecker was giving me the "Task got Future attached to a different loop" message mentioned at https://github.com/awestlake87/pyo3-asyncio/issues/19 so I applied the same change and nvchecker worked again. Environment: Python 3.9 on Debian Bullseye --- nvchecker/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvchecker/__main__.py b/nvchecker/__main__.py index 6e812fc..49b7226 100755 --- a/nvchecker/__main__.py +++ b/nvchecker/__main__.py @@ -78,7 +78,7 @@ def main() -> None: result_coro = core.process_result(oldvers, result_q, entry_waiter) runner_coro = core.run_tasks(futures) - newvers, has_failures = asyncio.run(run(result_coro, runner_coro)) + newvers, has_failures = asyncio.get_event_loop().run_until_complete(run(result_coro, runner_coro)) if options.ver_files is not None: core.write_verfile(options.ver_files[1], newvers)