diff options
Diffstat (limited to 'Python/ast.c')
-rw-r--r-- | Python/ast.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/ast.c b/Python/ast.c index 976be70..8b3dbea 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -4671,12 +4671,12 @@ warn_invalid_escape_sequence(struct compiling *c, const node *n, if (msg == NULL) { return -1; } - if (PyErr_WarnExplicitObject(PyExc_SyntaxWarning, msg, + if (PyErr_WarnExplicitObject(PyExc_DeprecationWarning, msg, c->c_filename, LINENO(n), NULL, NULL) < 0) { - if (PyErr_ExceptionMatches(PyExc_SyntaxWarning)) { - /* Replace the SyntaxWarning exception with a SyntaxError + if (PyErr_ExceptionMatches(PyExc_DeprecationWarning)) { + /* Replace the DeprecationWarning exception with a SyntaxError to get a more accurate error report */ PyErr_Clear(); ast_error(c, n, "%U", msg); |