Message190365
The following code will sometimes warn about an ignored TypeError('catching classes that do not inherit from BaseException is not allowed',) on termination:
class MyException(Exception):
pass
def gen():
try:
yield
except MyException:
pass
g = gen()
next(g)
Of course, MyException inherits from Exception, so there should be no problem.
Apparently, MyException gets destroyed before the generator object (at least sometimes, presumably depending on the hash randomization seed), and the destructor of the generator object then complains because there is no MyException any more. At least that's my explanation of this, without having digged into the code. |
|
Date |
User |
Action |
Args |
2013-05-30 15:35:59 | hagen | set | recipients:
+ hagen |
2013-05-30 15:35:59 | hagen | set | messageid: <1369928159.24.0.947067999583.issue18102@psf.upfronthosting.co.za> |
2013-05-30 15:35:59 | hagen | link | issue18102 messages |
2013-05-30 15:35:58 | hagen | create | |
|