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

@ -1622,7 +1622,7 @@ ValueError: 7
>>> 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: