no-no.
Fixes issue #1147. Need to fix 2.5 to raise a proper warning if a string
exception is passed in.
>>> f().throw("abc") # throw on just-opened generator
Traceback (most recent call last):
...
-abc
+TypeError: exceptions must be classes, or instances, not str
Now let's try closing a generator:
Core and builtins
-----------------
+- Issue #1147: Exceptions were directly allowing string exceptions in their
+ throw() method even though string exceptions no longer allowed.
+
- Issue #1096: Prevent a segfault from getting the repr of a very deeply nested
list by using the recursion counter.
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",