Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
EliahKagan committed Dec 26, 2023
commit c1f6c17182d59b9098aeac272dba79d912c5fa42
2 changes: 1 addition & 1 deletion test/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def test_it_executes_git_not_from_cwd(self, rw_dir, case):
if os.name == "nt":
# Copy an actual binary executable that is not git. (On Windows, running
# "hostname" only displays the hostname, it never tries to change it.)
other_exe_path = os.path.join(os.getenv("WINDIR"), "system32", "hostname.exe")
other_exe_path = os.path.join(os.environ["SystemRoot"], "system32", "hostname.exe")
impostor_path = os.path.join(rw_dir, "git.exe")
shutil.copy(other_exe_path, impostor_path)
else:
Expand Down