mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +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
|
@ -7,7 +7,6 @@ that name.
|
|||
|
||||
import sys
|
||||
import os
|
||||
from stat import *
|
||||
|
||||
__all__ = ["getline","clearcache","checkcache"]
|
||||
|
||||
|
@ -52,7 +51,7 @@ def checkcache():
|
|||
except os.error:
|
||||
del cache[filename]
|
||||
continue
|
||||
if size != stat[ST_SIZE] or mtime != stat[ST_MTIME]:
|
||||
if size != stat.st_size or mtime != stat.st_mtime:
|
||||
del cache[filename]
|
||||
|
||||
|
||||
|
@ -96,6 +95,6 @@ def updatecache(filename):
|
|||
except IOError, msg:
|
||||
## print '*** Cannot open', fullname, ':', msg
|
||||
return []
|
||||
size, mtime = stat[ST_SIZE], stat[ST_MTIME]
|
||||
size, mtime = stat.st_size, stat.st_mtime
|
||||
cache[filename] = size, mtime, lines, fullname
|
||||
return lines
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue