Commit 8ffc1885 authored by Stefan Behnel's avatar Stefan Behnel

cleanup last commit

parent 2ccfbc71
...@@ -4279,22 +4279,18 @@ class ExceptClauseNode(Node): ...@@ -4279,22 +4279,18 @@ class ExceptClauseNode(Node):
else: else:
code.putln("/*except:*/ {") code.putln("/*except:*/ {")
# most simple case: empty body (pass) if self.exc_vars:
empty_body = not self.target and not self.excinfo_target and \ exc_vars = self.exc_vars
not getattr(self.body, 'stats', True) elif not getattr(self.body, 'stats', True):
# most simple case: no exception variable, empty body (pass)
if empty_body: # => reset the exception state, done
# most simple case: reset the exception state, done
code.putln("PyErr_Restore(0,0,0);") code.putln("PyErr_Restore(0,0,0);")
code.put_goto(end_label) code.put_goto(end_label)
code.putln("}") code.putln("}")
return return
if self.exc_vars:
exc_vars = self.exc_vars
else: else:
# during type analysis, we didn't know if we need these, # during type analysis, we didn't know if we need the
# but apparently, we do # exception value, but apparently, we do
exc_vars = [code.funcstate.allocate_temp(py_object_type, exc_vars = [code.funcstate.allocate_temp(py_object_type,
manage_ref=True) manage_ref=True)
for i in xrange(3)] for i in xrange(3)]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment