Replaced obsolete stat module constants with equivalent attributes

This commit is contained in:
Raymond Hettinger 2002-06-01 19:51:15 +00:00
parent 16e3c427f3
commit 32200aeac6
18 changed files with 59 additions and 79 deletions

View file

@ -46,9 +46,9 @@ def compile(file, cfile=None, dfile=None):
import os, marshal, __builtin__
f = open(file, 'U')
try:
timestamp = long(os.fstat(f.fileno())[8])
timestamp = long(os.fstat(f.fileno()).st_mtime)
except AttributeError:
timestamp = long(os.stat(file)[8])
timestamp = long(os.stat(file).st_mtime)
codestring = f.read()
# If parsing from a string, line breaks are \n (see parsetok.c:tok_nextc)
# Replace will return original string if pattern is not found, so