mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Not backported because of behaviour change.
This commit is contained in:
parent
a64988c001
commit
c6bb6c0f8c
4 changed files with 8 additions and 10 deletions
|
@ -22,15 +22,9 @@ def listdir(path):
|
|||
del cache[path]
|
||||
except KeyError:
|
||||
cached_mtime, list = -1, []
|
||||
try:
|
||||
mtime = os.stat(path).st_mtime
|
||||
except os.error:
|
||||
return []
|
||||
mtime = os.stat(path).st_mtime
|
||||
if mtime != cached_mtime:
|
||||
try:
|
||||
list = os.listdir(path)
|
||||
except os.error:
|
||||
return []
|
||||
list = os.listdir(path)
|
||||
list.sort()
|
||||
cache[path] = mtime, list
|
||||
return list
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue