]> granicus.if.org Git - python/commitdiff
getsize(), getatime(), getmtime():
authorFred Drake <fdrake@acm.org>
Fri, 23 Jul 1999 15:04:05 +0000 (15:04 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 23 Jul 1999 15:04:05 +0000 (15:04 +0000)
Constants from stat module were imported using "import *";
don't access them via stat.ST_*!

Reported by that other vR.  ;-)

Lib/macpath.py

index b19d5a1f660e653b52252d6dbf3cf9e5ee3811de..bd016d8864ac9870e4ac9f86fd53cacd78e4c739 100644 (file)
@@ -104,17 +104,17 @@ def isdir(s):
 def getsize(filename):
     """Return the size of a file, reported by os.stat()."""
     st = os.stat(filename)
-    return st[stat.ST_SIZE]
+    return st[ST_SIZE]
 
 def getmtime(filename):
     """Return the last modification time of a file, reported by os.stat()."""
     st = os.stat(filename)
-    return st[stat.ST_MTIME]
+    return st[ST_MTIME]
 
 def getatime(filename):
     """Return the last access time of a file, reported by os.stat()."""
     st = os.stat(filename)
-    return st[stat.ST_MTIME]
+    return st[ST_MTIME]
 
 
 # Return true if the pathname refers to a symbolic link.