summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author180909 <wjh180909@gmail.com>2022-04-02 20:58:26 (GMT)
committerGitHub <noreply@github.com>2022-04-02 20:58:26 (GMT)
commitc93a0ac6972221787d8bea1c41a9feb667ed3d2c (patch)
tree0422eed0ac25dd955424dd4f994d5ee446f27036
parent182e93c3f57b0c72e765c9896066d32e461c0865 (diff)
downloadcpython-c93a0ac6972221787d8bea1c41a9feb667ed3d2c.zip
cpython-c93a0ac6972221787d8bea1c41a9feb667ed3d2c.tar.gz
cpython-c93a0ac6972221787d8bea1c41a9feb667ed3d2c.tar.bz2
bpo-45114: Use lstat() instead of stat() in stat docs example (GH-29845)
-rw-r--r--Doc/library/stat.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/stat.rst b/Doc/library/stat.rst
index 98219ea..083dc5e 100644
--- a/Doc/library/stat.rst
+++ b/Doc/library/stat.rst
@@ -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)