提交 0504141b authored 作者: Frederic's avatar Frederic

Don't crash during error handling

上级 0918f003
......@@ -843,19 +843,13 @@ class Function(object):
# this is a new vm-provided function or c linker
# they need this because the exception manipulation
# done by raise_with_op is not implemented in C.
thunk = None
if hasattr(self.fn, 'thunks'):
# For the CVM
gof.link.raise_with_op(
self.fn.nodes[self.fn.position_of_error],
self.fn.thunks[self.fn.position_of_error],
storage_map=self.fn.storage_map)
else:
# For the c linker We don't have access from
# python to all the temps values So for now, we
# just don't print the extra shapes/strides info
gof.link.raise_with_op(
self.fn.nodes[self.fn.position_of_error],
storage_map=self.fn.storage_map)
thunk = self.fn.thunks[self.fn.position_of_error]
gof.link.raise_with_op(
node=self.fn.nodes[self.fn.position_of_error],
thunk=thunk,
storage_map=getattr(self.fn, 'storage_map', None))
else:
# old-style linkers raise their own exceptions
raise
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论