提交 ab94825c authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Replaced 'except' with 'except exception' to avoid catching interruption

上级 a6beb073
......@@ -1008,14 +1008,14 @@ class ModuleCache(object):
try:
shutil.rmtree(to_delete)
debug('Deleted: %s' % to_delete)
except:
except Exception:
warning('Could not delete %s' % to_delete)
continue
to_rename = os.path.join(self.dirname, base_dir)
if os.path.isdir(to_rename):
try:
shutil.move(to_rename, to_delete)
except:
except Exception:
warning('Could not move %s to %s' %
(to_rename, to_delete))
finally:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论