Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aa71583

Browse files
committed
Use attribute access instead of index access for namedtuple.
1 parent ccf03a1 commit aa71583

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Doc/library/stat.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Example::
8787

8888
for f in os.listdir(top):
8989
pathname = os.path.join(top, f)
90-
mode = os.stat(pathname)[ST_MODE]
90+
mode = os.stat(pathname).st_mode
9191
if S_ISDIR(mode):
9292
# It's a directory, recurse into it
9393
walktree(pathname, callback)

0 commit comments

Comments
 (0)