]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45114: Use lstat() instead of stat() in stat docs example (GH-29845)
author180909 <wjh180909@gmail.com>
Sat, 2 Apr 2022 20:58:26 +0000 (04:58 +0800)
committerGitHub <noreply@github.com>
Sat, 2 Apr 2022 20:58:26 +0000 (13:58 -0700)
Doc/library/stat.rst

index 98219eaee976192c146df5edf76533d817fef4a4..083dc5e3bcfd6866d616285393ed33dfc929304f 100644 (file)
@@ -109,7 +109,7 @@ Example::
 
        for f in os.listdir(top):
            pathname = os.path.join(top, f)
-           mode = os.stat(pathname).st_mode
+           mode = os.lstat(pathname).st_mode
            if S_ISDIR(mode):
                # It's a directory, recurse into it
                walktree(pathname, callback)