summaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2025-10-31 09:40:47 -0700
committerDylan Baker <dylan@pnwbakers.com>2025-10-31 12:03:06 -0700
commit29632e692eb66ddd3bad30f47e3bf43ccb1491df (patch)
treed5e5363374f545d4695bf22ba4638d71e47ba874 /mesonbuild
parentedb569de3f88b3871a2fefe18d967c3b996dcd77 (diff)
downloadmeson-29632e692eb66ddd3bad30f47e3bf43ccb1491df.tar.gz
Avoid setting asycnio loop policy if possible
The entire policy system has been deprecated in Python 3.14, and is slated for removal in 3.16. This has been caught by pylint, and is causing CI to fail. For our use case this is only relevant on Python 3.7 on Windows, as the default policy on 3.8 is set to the Proactor anyway.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/mtest.py2
-rw-r--r--mesonbuild/scripts/run_tool.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index f5e4bb519..a299a794f 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -2091,7 +2091,7 @@ class TestHarness:
self.open_logfiles()
# TODO: this is the default for python 3.8
- if sys.platform == 'win32':
+ if sys.platform == 'win32' and sys.version_info < (3, 8):
asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
asyncio.run(self._run_tests(runners))
diff --git a/mesonbuild/scripts/run_tool.py b/mesonbuild/scripts/run_tool.py
index e7300c14e..591c25c0c 100644
--- a/mesonbuild/scripts/run_tool.py
+++ b/mesonbuild/scripts/run_tool.py
@@ -121,7 +121,7 @@ def all_clike_files(name: str, srcdir: Path, builddir: Path) -> T.Iterable[Path]
yield f
def run_clang_tool(name: str, srcdir: Path, builddir: Path, fn: T.Callable[..., T.Coroutine[None, None, int]], *args: T.Any) -> int:
- if sys.platform == 'win32':
+ if sys.platform == 'win32' and sys.version_info < (3, 8):
asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
def wrapper(path: Path) -> T.Iterable[T.Coroutine[None, None, int]]:
@@ -129,7 +129,7 @@ def run_clang_tool(name: str, srcdir: Path, builddir: Path, fn: T.Callable[...,
return asyncio.run(_run_workers(all_clike_files(name, srcdir, builddir), wrapper))
def run_clang_tool_on_sources(name: str, srcdir: Path, builddir: Path, fn: T.Callable[..., T.Coroutine[None, None, int]], *args: T.Any) -> int:
- if sys.platform == 'win32':
+ if sys.platform == 'win32' and sys.version_info < (3, 8):
asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
source_files = set()
@@ -150,7 +150,7 @@ def run_clang_tool_on_sources(name: str, srcdir: Path, builddir: Path, fn: T.Cal
def run_tool_on_targets(fn: T.Callable[[T.Dict[str, T.Any]],
T.Iterable[T.Coroutine[None, None, int]]]) -> int:
- if sys.platform == 'win32':
+ if sys.platform == 'win32' and sys.version_info < (3, 8):
asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
with open('meson-info/intro-targets.json', encoding='utf-8') as fp: