aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-12-25 02:04:49 -0500
committerEli Schwartz <eschwartz@archlinux.org>2023-01-04 16:46:52 -0500
commitc5e766af75369009ab9de82baf6c7c7e18f66857 (patch)
treea17879b7dfa93bcace91067a93943c9e34c59a74 /mesonbuild
parent40315e6ebb754b5584680c5193540e4638b792a3 (diff)
downloadmeson-c5e766af75369009ab9de82baf6c7c7e18f66857.zip
meson-c5e766af75369009ab9de82baf6c7c7e18f66857.tar.gz
meson-c5e766af75369009ab9de82baf6c7c7e18f66857.tar.bz2
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.
Diffstat (limited to 'mesonbuild')
-rwxr-xr-xmesonbuild/msubprojects.py3
1 files changed, 2 insertions, 1 deletions
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]