summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-09-02 14:38:08 -0400
committerBenjamin Peterson <benjamin@python.org>2012-09-02 14:38:08 -0400
commit7d96d7d7b276c25a5b0c530c905c5f5e51127b86 (patch)
treea47d1496527fac96504e47eec7a49f3a67d8821e /Python
parente0772a2071aa586cac9007e810473379299b6cbd (diff)
downloadcpython-7d96d7d7b276c25a5b0c530c905c5f5e51127b86.tar.gz
move variable decl to the top of the function
Diffstat (limited to 'Python')
-rw-r--r--Python/ast.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 3d0e3844b7..d2bf032c50 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -89,7 +89,7 @@ new_identifier(const char* n, PyArena *arena)
static int
ast_error(const node *n, const char *errstr)
{
- PyObject *u = Py_BuildValue("zii", errstr, LINENO(n), n->n_col_offset);
+ PyObject *u = Py_BuildValue("zii", errstr, LINENO(n), n->n_col_offset), *save;
if (!u)
return 0;
/*
@@ -97,7 +97,7 @@ ast_error(const node *n, const char *errstr)
* exception in order to chain it. ast_error_finish, however, requires the
* error not to be normalized.
*/
- PyObject *save = PyThreadState_GET()->exc_value;
+ save = PyThreadState_GET()->exc_value;
PyThreadState_GET()->exc_value = NULL;
PyErr_SetObject(PyExc_SyntaxError, u);
PyThreadState_GET()->exc_value = save;