Merge 3.6

This commit is contained in:
Victor Stinner 2016-11-15 09:12:36 +01:00
commit d5f599a392
2 changed files with 27 additions and 1 deletions

View file

@ -4129,7 +4129,13 @@ warn_invalid_escape_sequence(struct compiling *c, const node *n,
NULL, NULL) < 0 &&
PyErr_ExceptionMatches(PyExc_DeprecationWarning))
{
const char *s = PyUnicode_AsUTF8(msg);
const char *s;
/* Replace the DeprecationWarning exception with a SyntaxError
to get a more accurate error report */
PyErr_Clear();
s = PyUnicode_AsUTF8(msg);
if (s != NULL) {
ast_error(c, n, s);
}