From: Victor Stinner Date: Thu, 25 Jan 2018 21:41:38 +0000 (+0100) Subject: bpo-32667: Fix tests when $PATH contains a file (#5324) X-Git-Tag: v2.7.15rc1~72 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6996f284d4d90aa05c46d9fe6f38d1030454b224;p=python 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. --- diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index a5a727efd6..ee2383b8a9 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -697,7 +697,7 @@ class ProcessTestCase(BaseTestCase): stdout=subprocess.PIPE, stderr=subprocess.PIPE) # ignore errors that indicate the command was not found - if c.exception.errno not in (errno.ENOENT, errno.EACCES): + if c.exception.errno not in (errno.ENOENT, errno.ENOTDIR, errno.EACCES): raise c.exception @unittest.skipIf(threading is None, "threading required")