From ed29fc55572426335ed64e4bf96869923cda3b30 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sat, 10 Sep 2022 23:06:46 +0100 Subject: [PATCH] `stubtest_third_party.py`: Make it work on Windows (#8720) --- 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 d2ea39350..ed0ece82d 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", [])