From 2b496e79293a8b80e8ba0e514e186b3b1467b64b Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 8 Aug 2021 21:04:02 +0300 Subject: bpo-42053: Remove misleading check in os.fwalk() (GH-27669) os.fwalk() does not support integer as the first argument, and never supported. --- Lib/os.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Lib/os.py b/Lib/os.py index 8cc70a1..ab7ef3c 100644 --- a/Lib/os.py +++ b/Lib/os.py @@ -461,8 +461,7 @@ if {open, stat} <= supports_dir_fd and {scandir, stat} <= supports_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: -- cgit v0.12