merge 3.2

This commit is contained in:
Benjamin Peterson 2012-09-02 14:38:15 -04:00
commit e9f72dbf0d
1 changed files with 2 additions and 2 deletions

View File

@ -585,7 +585,7 @@ new_identifier(const char* n, struct compiling *c)
static int static int
ast_error(const node *n, const char *errstr) 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) if (!u)
return 0; return 0;
/* /*
@ -593,7 +593,7 @@ ast_error(const node *n, const char *errstr)
* exception in order to chain it. ast_error_finish, however, requires the * exception in order to chain it. ast_error_finish, however, requires the
* error not to be normalized. * error not to be normalized.
*/ */
PyObject *save = PyThreadState_GET()->exc_value; save = PyThreadState_GET()->exc_value;
PyThreadState_GET()->exc_value = NULL; PyThreadState_GET()->exc_value = NULL;
PyErr_SetObject(PyExc_SyntaxError, u); PyErr_SetObject(PyExc_SyntaxError, u);
PyThreadState_GET()->exc_value = save; PyThreadState_GET()->exc_value = save;