summaryrefslogtreecommitdiffstats
path: root/Lib/ntpath.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2002-06-01 19:51:15 (GMT)
committerRaymond Hettinger <python@rcn.com>2002-06-01 19:51:15 (GMT)
commit32200aeac697fcb3f2b4528127a2fbf0a22a8f17 (patch)
treeb99f2c04d576a3699ab9a2b6dfc1fc0e31e3c734 /Lib/ntpath.py
parent16e3c427f35589ac3b83e8c13a8ec6495ec6cfa1 (diff)
downloadcpython-32200aeac697fcb3f2b4528127a2fbf0a22a8f17.zip
cpython-32200aeac697fcb3f2b4528127a2fbf0a22a8f17.tar.gz
cpython-32200aeac697fcb3f2b4528127a2fbf0a22a8f17.tar.bz2
Replaced obsolete stat module constants with equivalent attributes
Diffstat (limited to 'Lib/ntpath.py')
-rw-r--r--Lib/ntpath.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py
index 7b758d0..d376065 100644
--- a/Lib/ntpath.py
+++ b/Lib/ntpath.py
@@ -216,18 +216,15 @@ def commonprefix(m):
def getsize(filename):
"""Return the size of a file, reported by os.stat()"""
- st = os.stat(filename)
- return st[stat.ST_SIZE]
+ return os.stat(filename).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 os.stat(filename).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_ATIME]
+ return os.stat(filename).st_atime
# Is a path a symbolic link?
@@ -260,7 +257,7 @@ def isdir(path):
st = os.stat(path)
except os.error:
return False
- return stat.S_ISDIR(st[stat.ST_MODE])
+ return stat.S_ISDIR(st.st_mode)
# Is a path a regular file?
@@ -273,7 +270,7 @@ def isfile(path):
st = os.stat(path)
except os.error:
return False
- return stat.S_ISREG(st[stat.ST_MODE])
+ return stat.S_ISREG(st.st_mode)
# Is a path a mount point? Either a root (with or without drive letter)