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.
diff --git a/Lib/test/test_dtrace.py b/Lib/test/test_dtrace.py
index 47a5010..8612e27 100644
--- a/Lib/test/test_dtrace.py
+++ b/Lib/test/test_dtrace.py
@@ -79,7 +79,7 @@
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(