Commit 02c66d4
committed
gh-156376: Make test_environ_path_cwd independent of the ambient environment
shutil.which() only inserts the current directory into the search path when
_winapi.NeedCurrentDirectoryForExePath() returns true, and that consults the
NoDefaultCurrentDirectoryInExePath environment variable. On a machine where
that variable is set, TestWhich.test_environ_path_cwd and
TestWhichBytes.test_environ_path_cwd failed because which() correctly
declined to search the current directory.
Unset the variable inside the EnvironmentVarGuard the test already uses, so
an ambient value cannot change what the test exercises.1 parent 04242c0 commit 02c66d4
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2626 | 2626 | | |
2627 | 2627 | | |
2628 | 2628 | | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
2629 | 2635 | | |
2630 | 2636 | | |
2631 | 2637 | | |
| |||
0 commit comments