提交 2665ec64 authored 作者: Frederic Bastien's avatar Frederic Bastien

added an env variable THEANO_NOCLEANUP. When true, we don't delete any generated file.

上级 17f9b00b
...@@ -386,7 +386,7 @@ class ModuleCache(object): ...@@ -386,7 +386,7 @@ class ModuleCache(object):
try: try:
module = fn(location=location) # WILL FAIL FOR BAD C CODE module = fn(location=location) # WILL FAIL FOR BAD C CODE
except Exception, e: except Exception, e:
shutil.rmtree(location) _rmtree(location)
#try: #try:
#except Exception, ee: #except Exception, ee:
#error('failed to cleanup location', location, ee) #error('failed to cleanup location', location, ee)
...@@ -515,7 +515,11 @@ class ModuleCache(object): ...@@ -515,7 +515,11 @@ class ModuleCache(object):
def _rmtree(parent): def _rmtree(parent):
try: try:
if not os.getenv('THEANO_NOCLEANUP',0):
print "cmodule.py do cleanup"
shutil.rmtree(parent) shutil.rmtree(parent)
else:
print "cmodule.py don't cleanup"
except Exception, e: except Exception, e:
try: try:
# mark this directory for deletion by a future refresh() # mark this directory for deletion by a future refresh()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论