提交 d4acc241 authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix crash in theanp-cache list for subdirectory that don't have a key file.

上级 95f00390
...@@ -362,6 +362,8 @@ def print_compiledir_content(): ...@@ -362,6 +362,8 @@ def print_compiledir_content():
nb_keys = {} nb_keys = {}
for dir in os.listdir(compiledir): for dir in os.listdir(compiledir):
filename = os.path.join(compiledir, dir, "key.pkl") filename = os.path.join(compiledir, dir, "key.pkl")
if not os.path.exists(filename):
continue
with open(filename, 'rb') as file: with open(filename, 'rb') as file:
try: try:
keydata = pickle.load(file) keydata = pickle.load(file)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论