提交 3628239e authored 作者: Frederic Bastien's avatar Frederic Bastien

make theano-cache better handle keys that don't work well anymore.

上级 566fe6ae
...@@ -77,7 +77,7 @@ def cleanup(): ...@@ -77,7 +77,7 @@ def cleanup():
if len(keydata.keys) == 0: if len(keydata.keys) == 0:
shutil.rmtree(os.path.join(compiledir, directory)) shutil.rmtree(os.path.join(compiledir, directory))
except EOFError: except (EOFError, AttributeError):
_logger.error( _logger.error(
"Could not read key file '%s'. To complete " "Could not read key file '%s'. To complete "
"the clean-up, please remove manually " "the clean-up, please remove manually "
...@@ -159,6 +159,10 @@ def print_compiledir_content(): ...@@ -159,6 +159,10 @@ def print_compiledir_content():
nb_keys[len(keydata.keys)] += 1 nb_keys[len(keydata.keys)] += 1
except IOError: except IOError:
pass pass
except AttributeError:
_logger.error(
"Could not read key file '%s'.",
filename)
print_title("Theano cache: %s" % compiledir, overline='=', underline='=') print_title("Theano cache: %s" % compiledir, overline='=', underline='=')
print() print()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论