提交 879d9235 authored 作者: Frederic Bastien's avatar Frederic Bastien

Don't crash when the compiledir is empty and we try to refresh it. gh-3818

上级 3628239e
...@@ -747,7 +747,11 @@ class ModuleCache(object): ...@@ -747,7 +747,11 @@ class ModuleCache(object):
time_now = time.time() time_now = time.time()
# Go through directories in alphabetical order to ensure consistent # Go through directories in alphabetical order to ensure consistent
# behavior. # behavior.
subdirs = sorted(os.listdir(self.dirname)) try:
subdirs = sorted(os.listdir(self.dirname))
except OSError:
# This can happen if the dir don't exist.
subdirs = []
files, root = None, None # To make sure the "del" below works files, root = None, None # To make sure the "del" below works
for subdirs_elem in subdirs: for subdirs_elem in subdirs:
# Never clean/remove lock_dir # Never clean/remove lock_dir
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论