提交 ad8c4809 authored 作者: Frederic's avatar Frederic

When deleting old unversionned cache file, check any file in the directory.

上级 13d1a703
...@@ -1258,11 +1258,16 @@ class ModuleCache(object): ...@@ -1258,11 +1258,16 @@ class ModuleCache(object):
path = module_name_from_dir(os.path.join(self.dirname, path = module_name_from_dir(os.path.join(self.dirname,
filename), filename),
False) False)
# If it don't exist, use the directory to be sure # If it don't exist, use any file in the directory.
# to delete old stuff that could have been created
# by errors
if path is None: if path is None:
path = os.path.join(self.dirname, filename) path = os.path.join(self.dirname, filename)
files = os.listdir(path)
if files:
path = os.path.join(path, files[0])
else:
# If the directory is empty skip it.
# They are deleted elsewhere.
continue
age = time_now - last_access_time(path) age = time_now - last_access_time(path)
# In normal case, the processus that created this # In normal case, the processus that created this
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论