Skip to content

Commit 23962c2

Browse files
committed
Avoid errors on Windows due to the lack of SYSTEMROOT env var
1 parent 6540103 commit 23962c2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

setuptools/tests/test_bootstrap.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,8 @@ def test_bootstrap_sourcetree(tmp_path, bare_venv, setuptools_sourcetree):
4444
assert not (target / "setuptools/tests").is_dir()
4545
assert not (target / "pkg_resources/tests").is_dir()
4646

47+
# Avoid errors on Windows by copying env before modifying
48+
# https://stackoverflow.com/questions/58997105
49+
env = {**os.environ, "PYTHONPATH": str(target)}
4750
test = ["python", "-c", "print(__import__('setuptools').__version__)"]
48-
bare_venv.run(test, env={"PYTHONPATH": str(target)})
51+
bare_venv.run(test, env=env)

0 commit comments

Comments
 (0)