Message13979
In the following test script
-----
class Test:
def __iter__(self):
raise IOError
reduce(lambda x,y: x+y, Test())
-----
the real IOError exception is masked, i.e. the traceback is
-----
Traceback (most recent call last):
File "test.py", line 5, in ?
reduce(lambda x,y: x+y, Test())
TypeError: reduce() arg 2 must support iteration
-----
but IMHO should be
-----
Traceback (most recent call last):
File "test.py", line 3, in ?
raise IOError
IOError
-----
This can be fixed by removing the
PyErr_SetString(PyExc_TypeError, "reduce() arg 2 must
support iteration") call in
bltinmodule.c/buildtin_reduce().
|
|
Date |
User |
Action |
Args |
2007-08-23 14:09:56 | admin | link | issue665761 messages |
2007-08-23 14:09:56 | admin | create | |
|