diff --git a/Python/ast.c b/Python/ast.c --- a/Python/ast.c +++ b/Python/ast.c @@ -2089,16 +2089,18 @@ ast_for_atom(struct compiling *c, const case STRING: { expr_ty str = parsestrplus(c, n); if (!str) { const char *errtype = NULL; if (PyErr_ExceptionMatches(PyExc_UnicodeError)) errtype = "unicode error"; else if (PyErr_ExceptionMatches(PyExc_ValueError)) errtype = "value error"; + else if (PyErr_ExceptionMatches(PyExc_DeprecationWarning)) + errtype = "deprecated usage"; if (errtype) { char buf[128]; PyObject *type, *value, *tback, *errstr; PyErr_Fetch(&type, &value, &tback); errstr = PyObject_Str(value); if (errstr) { char *s = _PyUnicode_AsString(errstr); PyOS_snprintf(buf, sizeof(buf), "(%s) %s", errtype, s);