diff options
Diffstat (limited to 'Objects/genobject.c')
-rw-r--r-- | Objects/genobject.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c index 4d0c4f6ee8..bad485c2df 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -253,12 +253,11 @@ gen_throw(PyGenObject *gen, PyObject *args) } } - /* Allow raising builtin string exceptions */ - - else if (!PyString_CheckExact(typ)) { + else { /* Not something you can raise. throw() fails. */ PyErr_Format(PyExc_TypeError, - "exceptions must be classes, or instances, not %s", + "exceptions must be classes or instances " + "deriving from BaseException, not %s", typ->ob_type->tp_name); goto failed_throw; } |