[Python-Dev] Re-raise in absence of an "active" exception

"Martin v. Löwis" martin at v.loewis.de
Sat Jun 26 08:20:15 EDT 2004


Phillip J. Eby wrote:
>> >>> try:
>> ..   1/0
>> .. except:
>> ..   pass
>> ..
>> >>> raise
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in ?
>> TypeError: exceptions must be classes, instances, or strings 
>> (deprecated), not NoneType
>>
>> Here, the re-raise doesn't find an exception anymore, even
>> though non has been raised...
> 
> 
> Isn't each statement/block in the interactive interpreter run in a new 
> frame?

Yes, but why does that matter? If the language spec says
"the exception stays until the next exception is raised", then
the interpreter doesn't conform to the language spec, and has
a bug.

Regards,
Martin




More information about the Python-Dev mailing list