mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
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:
parent
0b7120258a
commit
4c20bc40d7
3 changed files with 5 additions and 5 deletions
|
@ -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:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue