From c5e766af75369009ab9de82baf6c7c7e18f66857 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 25 Dec 2022 02:04:49 -0500 Subject: be more explicit about asyncio usage `get_event_loop()` would always implicitly create one on demand, but Python upstream has decided it's a bad/confusing API. Explicitly starting our own, then setting it, is exactly equivalent other than not being scheduled for deprecation. --- mesonbuild/msubprojects.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mesonbuild') diff --git a/mesonbuild/msubprojects.py b/mesonbuild/msubprojects.py index d6c182a..1be8543 100755 --- a/mesonbuild/msubprojects.py +++ b/mesonbuild/msubprojects.py @@ -699,7 +699,8 @@ def run(options: 'Arguments') -> int: raise MesonException(f'Unknown subproject type {t!r}, supported types are: {ALL_TYPES_STRING}') tasks: T.List[T.Awaitable[bool]] = [] task_names: T.List[str] = [] - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) executor = ThreadPoolExecutor(options.num_processes) if types: wraps = [wrap for wrap in wraps if wrap.type in types] -- cgit v1.1