Generators had their throw() method allowing string exceptions. That's a

no-no.

Fixes issue #1147.  Need to fix 2.5 to raise a proper warning if a string
exception is passed in.
This commit is contained in:
Brett Cannon 2007-09-11 21:02:28 +00:00
parent 0b7120258a
commit 4c20bc40d7
3 changed files with 5 additions and 5 deletions

View file

@ -252,10 +252,7 @@ gen_throw(PyGenObject *gen, PyObject *args)
Py_INCREF(typ);
}
}
/* 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",