]> granicus.if.org Git - python/commitdiff
Use attribute access instead of index access for namedtuple.
authorGeorg Brandl <georg@python.org>
Mon, 1 Aug 2011 20:58:53 +0000 (22:58 +0200)
committerGeorg Brandl <georg@python.org>
Mon, 1 Aug 2011 20:58:53 +0000 (22:58 +0200)
Doc/library/stat.rst

index c9c399e30e98ca435d6e336ee086588f925d8769..a62d9da1074914594a452a772fd82ed8af5ec79c 100644 (file)
@@ -84,7 +84,7 @@ Example::
 
        for f in os.listdir(top):
            pathname = os.path.join(top, f)
-           mode = os.stat(pathname)[ST_MODE]
+           mode = os.stat(pathname).st_mode
            if S_ISDIR(mode):
                # It's a directory, recurse into it
                walktree(pathname, callback)