mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
Replaced obsolete stat module constants with equivalent attributes
This commit is contained in:
parent
16e3c427f3
commit
32200aeac6
18 changed files with 59 additions and 79 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue