From 1bc1a752498bd71b104d470a21f6a5f63919f7e2 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sat, 10 Sep 2022 16:44:05 +0100 Subject: [PATCH] `stubtest_third_party.py`: Make it work on Windows --- tests/stubtest_third_party.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/stubtest_third_party.py b/tests/stubtest_third_party.py index d2ea39350e36..ed0ece82d09e 100755 --- a/tests/stubtest_third_party.py +++ b/tests/stubtest_third_party.py @@ -38,8 +38,14 @@ def run_stubtest(dist: Path, *, verbose: bool = False) -> bool: venv_dir = Path(tmp) venv.create(venv_dir, with_pip=True, clear=True) - pip_exe = str(venv_dir / "bin" / "pip") - python_exe = str(venv_dir / "bin" / "python") + if sys.platform == "win32": + pip = venv_dir / "Scripts" / "pip.exe" + python = venv_dir / "Scripts" / "python.exe" + else: + pip = venv_dir / "bin" / "pip" + python = venv_dir / "bin" / "python" + + pip_exe, python_exe = str(pip), str(python) dist_version = metadata["version"] extras = stubtest_meta.get("extras", [])