Skip to content

Commit c1f6c17

Browse files
committed
Use SystemRoot instead of WINDIR, to fix tox
In most cases they will be the same, but WINDIR may be absent (or have a different value?) in rare cases. The practical reason it matters in GitPython's tests is that tox automatically passes SystemRoot through to environments on Windows.
1 parent 2b47933 commit c1f6c17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/test_git.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def test_it_executes_git_not_from_cwd(self, rw_dir, case):
150150
if os.name == "nt":
151151
# Copy an actual binary executable that is not git. (On Windows, running
152152
# "hostname" only displays the hostname, it never tries to change it.)
153-
other_exe_path = os.path.join(os.getenv("WINDIR"), "system32", "hostname.exe")
153+
other_exe_path = os.path.join(os.environ["SystemRoot"], "system32", "hostname.exe")
154154
impostor_path = os.path.join(rw_dir, "git.exe")
155155
shutil.copy(other_exe_path, impostor_path)
156156
else:

0 commit comments

Comments
 (0)