On Thu, 08 Mar 2007 06:31:20 -0300, Gabriel Genellina wrote:

> En Thu, 08 Mar 2007 06:17:37 -0300, Gerard Flanagan  
> <[EMAIL PROTECTED]> escribió:
> 
>> @onfail(False)
>> def a(x):
>>     if x == 1:
>>         return 'function a succeeded'
>>     else:
>>         raise
> 
> I know it's irrelevant, as you use a bare except, but such raise looks a  
> bit ugly...


I thought "raise" on its own was supposed to re-raise the previous
exception, but I've just tried it in the interactive interpreter and it
doesn't work for me.

>>> raise ValueError # prime a "previous exception"
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError
>>> raise # re-raise the previous exception?
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: exceptions must be classes, instances, or strings (deprecated), not 
NoneType


Have I misunderstood?



-- 
Steven D'Aprano 

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to