diff options
author | Brett Cannon <bcannon@gmail.com> | 2007-09-11 21:02:28 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2007-09-11 21:02:28 (GMT) |
commit | 4c20bc40d73a7f4a977475e4fa02f7c8a43d796a (patch) | |
tree | bda917217f80707f88ab8514b5c0e383fd677b40 /Objects | |
parent | 0b7120258a4df671291e39d3eb95a71a9dc4c186 (diff) | |
download | cpython-4c20bc40d73a7f4a977475e4fa02f7c8a43d796a.zip cpython-4c20bc40d73a7f4a977475e4fa02f7c8a43d796a.tar.gz cpython-4c20bc40d73a7f4a977475e4fa02f7c8a43d796a.tar.bz2 |
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.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/genobject.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c index 14cc46b..551d9fd 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -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", |