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

Refactored try / except / finally for Python 2.4 compatibility

上级 481bd2ef
...@@ -733,6 +733,9 @@ class ModuleCache(object): ...@@ -733,6 +733,9 @@ class ModuleCache(object):
'files in', config.compiledir) 'files in', config.compiledir)
raise raise
try:
# Embedding two try statements for Python 2.4 compatibility
# (cannot do try / except / finally).
try: try:
compile_steps = fn(location=location).__iter__() compile_steps = fn(location=location).__iter__()
...@@ -834,7 +837,6 @@ class ModuleCache(object): ...@@ -834,7 +837,6 @@ class ModuleCache(object):
self.module_hash_to_key_data[module_hash] = key_data self.module_hash_to_key_data[module_hash] = key_data
except: except:
# TODO try / except / finally is not Python2.4-friendly.
# This may happen e.g. when an Op has no C implementation. In # This may happen e.g. when an Op has no C implementation. In
# any case, we do not want to keep around the temporary work # any case, we do not want to keep around the temporary work
# directory, as it may cause trouble if we create too many of # directory, as it may cause trouble if we create too many of
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论