]> 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 4f79689207d2ec7c1d9fe00ff030062e3c23cbcd..7de98b6581e9f6c98668e78854a6118787985be3 100644 (file)
@@ -87,7 +87,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)