Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
50924b23
提交
50924b23
authored
3月 14, 2010
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix crash in refresh when a cache dir contains a key.pkl but no dll.
上级
8917fa7d
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
28 行增加
和
28 行删除
+28
-28
cmodule.py
theano/gof/cmodule.py
+28
-28
没有找到文件。
theano/gof/cmodule.py
浏览文件 @
50924b23
...
@@ -295,42 +295,42 @@ class ModuleCache(object):
...
@@ -295,42 +295,42 @@ class ModuleCache(object):
except
:
except
:
# the directory is still in use?? We just leave it for future removal.
# the directory is still in use?? We just leave it for future removal.
pass
pass
elif
'key.pkl'
in
files
and
(
time_now
-
last_access_time
(
module_name_from_dir
(
root
)))
<
self
.
age_thresh_use
:
elif
'key.pkl'
in
files
:
key_pkl
=
os
.
path
.
join
(
root
,
'key.pkl'
)
debug
(
'refresh adding'
,
key_pkl
)
try
:
try
:
key
=
cPickle
.
load
(
open
(
key_pkl
,
'rb'
))
entry
=
module_name_from_dir
(
root
)
except
:
except
ValueError
:
# there is a key but no dll!
info
(
"ModuleCache.refresh() Failed to unpickle cache key"
,
key_pkl
)
warning
(
"ModuleCache.refresh() Found key without dll in cache, deleting it."
,
key_pkl
)
if
0
:
info
(
"Erasing broken cache directory"
,
key_pkl
)
shutil
.
rmtree
(
root
)
else
:
## This exception is often triggered by keys that contain
# references to classes that have not yet been imported. They are
# not necessarily broken
pass
continue
if
not
key
[
0
]:
#if the version is False
warning
(
"ModuleCache.refresh() Found unversioned key in cache, deleting it."
,
key_pkl
)
info
(
"Erasing broken cache directory"
,
key_pkl
)
info
(
"Erasing broken cache directory"
,
key_pkl
)
shutil
.
rmtree
(
root
)
shutil
.
rmtree
(
root
)
continue
continue
if
(
time_now
-
last_access_time
(
module_name_from_dir
(
root
)))
<
self
.
age_thresh_use
:
if
key
not
in
self
.
entry_from_key
:
key_pkl
=
os
.
path
.
join
(
root
,
'key.pkl'
)
debug
(
'refresh adding'
,
key_pkl
)
try
:
try
:
entry
=
module_name_from_dir
(
root
)
key
=
cPickle
.
load
(
open
(
key_pkl
,
'rb'
))
except
ValueError
:
# there is a key but no dll!
except
:
warning
(
"ModuleCache.refresh() Found key without dll in cache, deleting it."
,
key_pkl
)
info
(
"ModuleCache.refresh() Failed to unpickle cache key"
,
key_pkl
)
if
0
:
info
(
"Erasing broken cache directory"
,
key_pkl
)
shutil
.
rmtree
(
root
)
else
:
## This exception is often triggered by keys that contain
# references to classes that have not yet been imported. They are
# not necessarily broken
pass
continue
if
not
key
[
0
]:
#if the version is False
warning
(
"ModuleCache.refresh() Found unversioned key in cache, deleting it."
,
key_pkl
)
info
(
"Erasing broken cache directory"
,
key_pkl
)
info
(
"Erasing broken cache directory"
,
key_pkl
)
shutil
.
rmtree
(
root
)
shutil
.
rmtree
(
root
)
continue
continue
self
.
entry_from_key
[
key
]
=
entry
if
key
not
in
self
.
entry_from_key
:
# assert that we haven't already got this entry somehow
self
.
entry_from_key
[
key
]
=
entry
assert
entry
not
in
self
.
module_from_name
# assert that we haven't already got this entry somehow
self
.
loaded_key_pkl
.
add
(
key_pkl
)
assert
entry
not
in
self
.
module_from_name
self
.
loaded_key_pkl
.
add
(
key_pkl
)
# remove entries that are not in the filesystem
# remove entries that are not in the filesystem
items_copy
=
list
(
self
.
entry_from_key
.
iteritems
())
items_copy
=
list
(
self
.
entry_from_key
.
iteritems
())
...
@@ -352,7 +352,7 @@ class ModuleCache(object):
...
@@ -352,7 +352,7 @@ class ModuleCache(object):
info
(
"deleting ModuleCache entry"
,
entry
)
info
(
"deleting ModuleCache entry"
,
entry
)
del
self
.
entry_from_key
[
key
]
del
self
.
entry_from_key
[
key
]
if
key
[
0
]:
if
key
[
0
]:
# this is a versioned entry, so should have been on disk
# this is a versioned entry, so should have been on disk
# Something weird happened to cause this, so we are responding by
# Something weird happened to cause this, so we are responding by
# printing a warning, removing evidence that we ever saw this mystery
# printing a warning, removing evidence that we ever saw this mystery
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论