summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2006-02-27 23:15:56 +0000
committerBrett Cannon <bcannon@gmail.com>2006-02-27 23:15:56 +0000
commit68e4cbbcb6e129d468bf4a9e121684ce578735d5 (patch)
tree18325c9b6a15ad4ec6c91c888d4f0bc2347e18f4 /Python
parent9e777e5c6ad7e1ab24742c2578c66f692bc19eb9 (diff)
downloadcpython-git-68e4cbbcb6e129d468bf4a9e121684ce578735d5.tar.gz
Return value off PyErr_Warn() for raising string exceptions was not being
checked. Problem when 'warnings' was set to "error" and thus would re-raise a new exception.
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 3779ae2bdb..474d89b1cd 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2955,12 +2955,14 @@ do_raise(PyObject *type, PyObject *value, PyObject *tb)
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 (PyErr_Warn(PyExc_PendingDeprecationWarning,
+ "raising a string exception is deprecated"))
+ goto raise_error;
+ }
else if (PyClass_Check(type))
PyErr_NormalizeException(&type, &value, &tb);