rhs = typecast(py_object_type, self.type, rhs)
else:
lhs = ""
+ # <fsw> added for generating C++ try/catch block
+ if func_type.exception_check == '+':
+ code.putln(
+ "try {%s%s;} catch(...) {CppExn2PyErr(); %s}" % (
+ lhs,
+ rhs,
+ code.error_goto(self.pos)))
+ return
code.putln(
"%s%s; %s" % (
lhs,
exc_clause = " except? %s" % self.exception_value
elif self.exception_value:
exc_clause = " except %s" % self.exception_value
- elif self.exception_check:
- exc_clause = " except *"
+ elif self.exception_check == '+':
+ exc_clause = " except +"
+ else:
+ " except *"
cc = self.calling_convention_prefix()
if (not entity_code and cc) or entity_code.startswith("*"):
entity_code = "(%s%s)" % (cc, entity_code)