]> granicus.if.org Git - python/commitdiff
bpo-32667: Fix tests when $PATH contains a file (#5324)
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 25 Jan 2018 21:41:38 +0000 (22:41 +0100)
committerGitHub <noreply@github.com>
Thu, 25 Jan 2018 21:41:38 +0000 (22:41 +0100)
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.

Lib/test/test_subprocess.py

index a5a727efd62d4301f261b34c38623a1be94fdef9..ee2383b8a93522622ceae4bec18b84208f015ffc 100644 (file)
@@ -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")