Skip to content

Commit 2b496e7

Browse files
bpo-42053: Remove misleading check in os.fwalk() (GH-27669)
os.fwalk() does not support integer as the first argument, and never supported.
1 parent 0eec627 commit 2b496e7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Lib/os.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,7 @@ def fwalk(top=".", topdown=True, onerror=None, *, follow_symlinks=False, dir_fd=
461461
dirs.remove('CVS') # don't visit CVS directories
462462
"""
463463
sys.audit("os.fwalk", top, topdown, onerror, follow_symlinks, dir_fd)
464-
if not isinstance(top, int) or not hasattr(top, '__index__'):
465-
top = fspath(top)
464+
top = fspath(top)
466465
# Note: To guard against symlink races, we use the standard
467466
# lstat()/open()/fstat() trick.
468467
if not follow_symlinks:

0 commit comments

Comments
 (0)