summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/os.py')
-rw-r--r--Lib/os.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/os.py b/Lib/os.py
index 7f38e14..7661ce6 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -475,7 +475,7 @@ if {open, stat} <= supports_dir_fd and {scandir, stat} <= supports_fd:
# lstat()/open()/fstat() trick.
if not follow_symlinks:
orig_st = stat(top, follow_symlinks=False, dir_fd=dir_fd)
- topfd = open(top, O_RDONLY, dir_fd=dir_fd)
+ topfd = open(top, O_RDONLY | O_NONBLOCK, dir_fd=dir_fd)
try:
if (follow_symlinks or (st.S_ISDIR(orig_st.st_mode) and
path.samestat(orig_st, stat(topfd)))):
@@ -524,7 +524,7 @@ if {open, stat} <= supports_dir_fd and {scandir, stat} <= supports_fd:
assert entries is not None
name, entry = name
orig_st = entry.stat(follow_symlinks=False)
- dirfd = open(name, O_RDONLY, dir_fd=topfd)
+ dirfd = open(name, O_RDONLY | O_NONBLOCK, dir_fd=topfd)
except OSError as err:
if onerror is not None:
onerror(err)