1.1 --- a/translator.py Thu Jan 12 21:09:51 2017 +0100
1.2 +++ b/translator.py Thu Jan 12 21:37:43 2017 +0100
1.3 @@ -1417,15 +1417,24 @@
1.4 # NOTE: Determine which raise statement variants should be permitted.
1.5
1.6 if n.expr1:
1.7 - exc = self.process_structure_node(n.expr1)
1.8 +
1.9 + # Names with accompanying arguments are treated like invocations.
1.10 +
1.11 + if n.expr2:
1.12 + call = compiler.ast.CallFunc(n.expr1, [n.expr2])
1.13 + exc = self.process_structure_node(call)
1.14 + self.writestmt("__Raise(%s);" % exc)
1.15
1.16 # Raise instances, testing the kind at run-time if necessary and
1.17 # instantiating any non-instance.
1.18
1.19 - if isinstance(exc, TrInstanceRef):
1.20 - self.writestmt("__Raise(%s);" % exc)
1.21 else:
1.22 - self.writestmt("__Raise(__ensure_instance(%s));" % exc)
1.23 + exc = self.process_structure_node(n.expr1)
1.24 +
1.25 + if isinstance(exc, TrInstanceRef):
1.26 + self.writestmt("__Raise(%s);" % exc)
1.27 + else:
1.28 + self.writestmt("__Raise(__ensure_instance(%s));" % exc)
1.29 else:
1.30 self.writestmt("__Throw(__tmp_exc);")
1.31