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

Skip to content

Commit 69f87c5

Browse files
committed
getsize(), getatime(), getmtime():
Constants from stat module were imported using "import *"; don't access them via stat.ST_*! Reported by that other vR. ;-)
1 parent de5d5ce commit 69f87c5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/macpath.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,17 @@ def isdir(s):
104104
def getsize(filename):
105105
"""Return the size of a file, reported by os.stat()."""
106106
st = os.stat(filename)
107-
return st[stat.ST_SIZE]
107+
return st[ST_SIZE]
108108

109109
def getmtime(filename):
110110
"""Return the last modification time of a file, reported by os.stat()."""
111111
st = os.stat(filename)
112-
return st[stat.ST_MTIME]
112+
return st[ST_MTIME]
113113

114114
def getatime(filename):
115115
"""Return the last access time of a file, reported by os.stat()."""
116116
st = os.stat(filename)
117-
return st[stat.ST_MTIME]
117+
return st[ST_MTIME]
118118

119119

120120
# Return true if the pathname refers to a symbolic link.

0 commit comments

Comments
 (0)