bpo-32667: Fix tests when $PATH contains a file (#5322)

Some tests failed when the PATH environment variable contained a path
to an existing file. Fix tests to ignore also NotADirectoryError, not
only FileNotFoundError and PermissionError.
This commit is contained in:
Victor Stinner 2018-01-25 19:06:05 +01:00 committed by GitHub
parent 93a6119f08
commit b31206a223
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 9 deletions

View file

@ -79,7 +79,7 @@ class TraceBackend:
try:
output = self.trace(abspath("assert_usable" + self.EXTENSION))
output = output.strip()
except (FileNotFoundError, PermissionError) as fnfe:
except (FileNotFoundError, NotADirectoryError, PermissionError) as fnfe:
output = str(fnfe)
if output != "probe: success":
raise unittest.SkipTest(