提交 5ac451bd authored 作者: Frederic's avatar Frederic

Make the error detection work with python 3.3.

It was making a test crash with python 3.3
上级 32ed39fb
...@@ -135,9 +135,14 @@ class Apply(Node): ...@@ -135,9 +135,14 @@ class Apply(Node):
if len(self.outputs) == 1: if len(self.outputs) == 1:
return self.outputs[0] return self.outputs[0]
else: else:
raise AttributeError("%s.default_output should be an output index." % self.op) raise AttributeError(
"%s.default_output should be an output index." % self.op)
elif not isinstance(do, (int, long)):
raise AttributeError("%s.default_output should be an int or long" %
self.op)
elif do < 0 or do >= len(self.outputs): elif do < 0 or do >= len(self.outputs):
raise AttributeError("%s.default_output is out of range." % self.op) raise AttributeError("%s.default_output is out of range." %
self.op)
return self.outputs[do] return self.outputs[do]
def env_getter(self): def env_getter(self):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论