Commit 6ef7d223 authored by Stefan Behnel's avatar Stefan Behnel

Minor code cleanups.

parent e5aabcd1
...@@ -6,10 +6,11 @@ ...@@ -6,10 +6,11 @@
from __future__ import absolute_import from __future__ import absolute_import
import cython import cython
cython.declare(os=object, re=object, operator=object, cython.declare(os=object, re=object, operator=object, textwrap=object,
Naming=object, Options=object, StringEncoding=object, Template=object, Naming=object, Options=object, StringEncoding=object,
Utils=object, SourceDescriptor=object, StringIOTree=object, Utils=object, SourceDescriptor=object, StringIOTree=object,
DebugFlags=object, basestring=object) DebugFlags=object, basestring=object, defaultdict=object,
closing=object, partial=object)
import os import os
import re import re
......
...@@ -6946,8 +6946,8 @@ class ExceptClauseNode(Node): ...@@ -6946,8 +6946,8 @@ class ExceptClauseNode(Node):
exc_args = "&%s, &%s, &%s" % tuple(exc_vars) exc_args = "&%s, &%s, &%s" % tuple(exc_vars)
code.putln("if (__Pyx_GetException(%s) < 0) %s" % ( code.putln("if (__Pyx_GetException(%s) < 0) %s" % (
exc_args, code.error_goto(self.pos))) exc_args, code.error_goto(self.pos)))
for x in exc_vars: for var in exc_vars:
code.put_gotref(x) code.put_gotref(var)
if self.target: if self.target:
self.exc_value.set_var(exc_vars[1]) self.exc_value.set_var(exc_vars[1])
self.exc_value.generate_evaluation_code(code) self.exc_value.generate_evaluation_code(code)
...@@ -6964,6 +6964,7 @@ class ExceptClauseNode(Node): ...@@ -6964,6 +6964,7 @@ class ExceptClauseNode(Node):
code.funcstate.exc_vars = exc_vars code.funcstate.exc_vars = exc_vars
self.body.generate_execution_code(code) self.body.generate_execution_code(code)
code.funcstate.exc_vars = old_exc_vars code.funcstate.exc_vars = old_exc_vars
if not self.body.is_terminator: if not self.body.is_terminator:
for var in exc_vars: for var in exc_vars:
code.put_decref_clear(var, py_object_type) code.put_decref_clear(var, py_object_type)
......
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