Skip to content

Commit 6996f28

Browse files
authored
bpo-32667: Fix tests when $PATH contains a file (#5324)
test_subprocess.test_leaking_fds_on_error() failed when the PATH environment variable contains a path to an existing file. Fix the test: ignore also ENOTDIR, not only ENOENT and EACCES.
1 parent e64a47b commit 6996f28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/test_subprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ def test_leaking_fds_on_error(self):
697697
stdout=subprocess.PIPE,
698698
stderr=subprocess.PIPE)
699699
# ignore errors that indicate the command was not found
700-
if c.exception.errno not in (errno.ENOENT, errno.EACCES):
700+
if c.exception.errno not in (errno.ENOENT, errno.ENOTDIR, errno.EACCES):
701701
raise c.exception
702702

703703
@unittest.skipIf(threading is None, "threading required")

0 commit comments

Comments
 (0)