8000 gh-104522: Add case for NotDirectoryError · PurityLake/cpython@95653b1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 95653b1

Browse files
committed
pythongh-104522: Add case for NotDirectoryError
1 parent 36ba1af commit 95653b1

File tree

1 file changed

+2
-1
lines chan 8000 ged

1 file changed

+2
-1
lines changed

Lib/subprocess.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,8 @@ def _execute_child(self, args, executable, preexec_fn, close_fds,
19451945
# is the issue, otherwise we should just return the error without setting
19461946
# a filename.
19471947
temp_error = child_exception_type(errno_num, "foo")
1948-
if issubclass(temp_error.__class__, FileNotFoundError):
1948+
if isinstance(temp_error, FileNotFoundError) \
1949+
or isinstance(temp_error, NotADirectoryError):
19491950
err_msg = ""
19501951
# The error must be from chdir(cwd).
19511952
err_filename = cwd

0 commit comments

Comments
 (0)
0