提交 5229fdba authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Move creation of variable before referencement...

This fixes a crash when a key.pkl file is present in a compilation cache directory, but no .dll (or .so)
上级 83de4225
......@@ -296,6 +296,7 @@ class ModuleCache(object):
# the directory is still in use?? We just leave it for future removal.
pass
elif 'key.pkl' in files:
key_pkl = os.path.join(root, 'key.pkl')
try:
entry = module_name_from_dir(root)
except ValueError: # there is a key but no dll!
......@@ -304,7 +305,6 @@ class ModuleCache(object):
shutil.rmtree(root)
continue
if (time_now - last_access_time(module_name_from_dir(root)))<self.age_thresh_use:
key_pkl = os.path.join(root, 'key.pkl')
debug('refresh adding', key_pkl)
try:
key = cPickle.load(open(key_pkl, 'rb'))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论