Skip to content

Commit

Permalink
bpo-42053: Remove misleading check in os.fwalk() (pythonGH-27669)
Browse files Browse the repository at this point in the history
os.fwalk() does not support integer as the first argument,
and never supported.
  • Loading branch information
serhiy-storchaka committed Aug 8, 2021
1 parent 0eec627 commit 2b496e7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Lib/os.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,7 @@ def fwalk(top=".", topdown=True, onerror=None, *, follow_symlinks=False, dir_fd=
dirs.remove('CVS') # don't visit CVS directories
"""
sys.audit("os.fwalk", top, topdown, onerror, follow_symlinks, dir_fd)
if not isinstance(top, int) or not hasattr(top, '__index__'):
top = fspath(top)
top = fspath(top)
# Note: To guard against symlink races, we use the standard
# lstat()/open()/fstat() trick.
if not follow_symlinks:
Expand Down

0 comments on commit 2b496e7

Please sign in to comment.