Mercurial > cpython-lru_cache-weakref
diff Python/ceval.c @ 36702:35dbbc1ab448 legacy-trunk
Check the return code for PyErr_Warn() when warning about raising string
exceptions. This was triggered when 'warnings' had a filter set to "error"
that caught the string exception deprecation warning.
| author | Brett Cannon <bcannon@gmail.com> |
|---|---|
| date | Mon, 27 Feb 2006 23:39:10 +0000 |
| parents | b6d2f6fd3e11 |
| children | 5c36c222e7ca |
line wrap: on
line diff
--- a/Python/ceval.c Mon Feb 27 23:29:46 2006 +0000 +++ b/Python/ceval.c Mon Feb 27 23:39:10 2006 +0000 @@ -2997,13 +2997,14 @@ Py_DECREF(tmp); } - if (PyString_CheckExact(type)) + if (PyString_CheckExact(type)) { /* Raising builtin string is deprecated but still allowed -- * do nothing. Raising an instance of a new-style str * subclass is right out. */ - PyErr_Warn(PyExc_PendingDeprecationWarning, - "raising a string exception is deprecated"); - + if (-1 == PyErr_Warn(PyExc_PendingDeprecationWarning, + "raising a string exception is deprecated")) + goto raise_error; + } else if (PyClass_Check(type)) PyErr_NormalizeException(&type, &value, &tb);
