Skip to content
Prev Previous commit
Skip os.unlink() if os.DirEntry.is_dir() raises FileNotFoundError
  • Loading branch information
barneygale committed May 31, 2024
commit a53e4736d6ce28cc11e68b63b69fec3951831dcb
2 changes: 2 additions & 0 deletions Lib/shutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,8 @@ def _rmtree_safe_fd(stack, onexc):
# Traverse into sub-directory.
stack.append((os.lstat, topfd, fullname, entry))
continue
except FileNotFoundError:
continue
except OSError:
pass
try:
Expand Down