Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c5d7518

Browse files
committed
move variable decl to the top of the function
1 parent 2e2c903 commit c5d7518

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Python/ast.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ new_identifier(const char* n, PyArena *arena)
8989
static int
9090
ast_error(const node *n, const char *errstr)
9191
{
92-
PyObject *u = Py_BuildValue("zii", errstr, LINENO(n), n->n_col_offset);
92+
PyObject *u = Py_BuildValue("zii", errstr, LINENO(n), n->n_col_offset), *save;
9393
if (!u)
9494
return 0;
9595
/*
9696
* Prevent the error from being chained. PyErr_SetObject will normalize the
9797
* exception in order to chain it. ast_error_finish, however, requires the
9898
* error not to be normalized.
9999
*/
100-
PyObject *save = PyThreadState_GET()->exc_value;
100+
save = PyThreadState_GET()->exc_value;
101101
PyThreadState_GET()->exc_value = NULL;
102102
PyErr_SetObject(PyExc_SyntaxError, u);
103103
PyThreadState_GET()->exc_value = save;

0 commit comments

Comments
 (0)