diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2025-10-31 09:40:47 -0700 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-10-31 12:03:06 -0700 |
| commit | 29632e692eb66ddd3bad30f47e3bf43ccb1491df (patch) | |
| tree | d5e5363374f545d4695bf22ba4638d71e47ba874 /mesonbuild/scripts | |
| parent | edb569de3f88b3871a2fefe18d967c3b996dcd77 (diff) | |
| download | meson-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/scripts')
| -rw-r--r-- | mesonbuild/scripts/run_tool.py | 6 |
1 files changed, 3 insertions, 3 deletions
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: |
