diff Doc/lib/libstat.tex @ 29542:69bc7ca5cc1a legacy-trunk

Avoid using 'dir' as a variable name and use os.path.join() to create paths.
author Skip Montanaro <skip@pobox.com>
date Thu, 19 Jun 2003 18:10:37 +0000
parents bc02c3b09626
children 606aae95f128
line wrap: on
line diff
--- a/Doc/lib/libstat.tex	Thu Jun 19 10:36:17 2003 +0000
+++ b/Doc/lib/libstat.tex	Thu Jun 19 18:10:37 2003 +0000
@@ -129,12 +129,12 @@
 import os, sys
 from stat import *
 
-def walktree(dir, callback):
-    '''recursively descend the directory rooted at dir,
+def walktree(top, callback):
+    '''recursively descend the directory tree rooted at top,
        calling the callback function for each regular file'''
 
-    for f in os.listdir(dir):
-        pathname = '%s/%s' % (dir, f)
+    for f in os.listdir(top):
+        pathname = os.path.join(top, f)
         mode = os.stat(pathname)[ST_MODE]
         if S_ISDIR(mode):
             # It's a directory, recurse into it