提交 eacb040a authored 作者: affanv14's avatar affanv14

add another call to restore_defaults before raise

上级 b7136d80
...@@ -810,6 +810,7 @@ class Function(object): ...@@ -810,6 +810,7 @@ class Function(object):
e.args = ("Bad input " + argument_name + " to " + e.args = ("Bad input " + argument_name + " to " +
function_name + " at index %d (0-based). %s" function_name + " at index %d (0-based). %s"
% (i, where),) + e.args % (i, where),) + e.args
restore_defaults()
raise raise
s.provided += 1 s.provided += 1
i += 1 i += 1
...@@ -882,6 +883,7 @@ class Function(object): ...@@ -882,6 +883,7 @@ class Function(object):
self.fn() if output_subset is None else\ self.fn() if output_subset is None else\
self.fn(output_subset=output_subset) self.fn(output_subset=output_subset)
except Exception: except Exception:
restore_defaults()
if hasattr(self.fn, 'position_of_error'): if hasattr(self.fn, 'position_of_error'):
# this is a new vm-provided function or c linker # this is a new vm-provided function or c linker
# they need this because the exception manipulation # they need this because the exception manipulation
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论