From: Serhiy Storchaka Date: Sun, 8 Aug 2021 18:04:02 +0000 (+0300) Subject: bpo-42053: Remove misleading check in os.fwalk() (GH-27669) X-Git-Tag: v3.11.0a1~448 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2b496e79293a8b80e8ba0e514e186b3b1467b64b;p=thirdparty%2FPython%2Fcpython.git bpo-42053: Remove misleading check in os.fwalk() (GH-27669) os.fwalk() does not support integer as the first argument, and never supported. --- diff --git a/Lib/os.py b/Lib/os.py index 8cc70a11e9bc..ab7ef3c17798 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: