summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorPhillip J. Eby <pje@telecommunity.com>2006-03-25 00:05:50 (GMT)
committerPhillip J. Eby <pje@telecommunity.com>2006-03-25 00:05:50 (GMT)
commitbee071221419795d707a15286e08424d141a6ca6 (patch)
tree1a507dcab84a78155055db907b418bff9932cc05 /Objects
parent43b00da219d8490631f37cd4424fca30e1848404 (diff)
downloadcpython-bee071221419795d707a15286e08424d141a6ca6.zip
cpython-bee071221419795d707a15286e08424d141a6ca6.tar.gz
cpython-bee071221419795d707a15286e08424d141a6ca6.tar.bz2
Support throw() of string exceptions.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/genobject.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 3f6ef85..e7b8f87 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -249,7 +249,10 @@ gen_throw(PyGenObject *gen, PyObject *args)
Py_INCREF(typ);
}
}
- else {
+
+ /* Allow raising builtin string exceptions */
+
+ else if (!PyString_CheckExact(typ)) {
/* Not something you can raise. throw() fails. */
PyErr_Format(PyExc_TypeError,
"exceptions must be classes, or instances, not %s",