Error handling in file generation (Pythonic way: with / decorators?)

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Fri Aug 31 01:22:33 EDT 2007


In message <1188378461.388224.164030 at 50g2000hsm.googlegroups.com>, xavim
wrote:

> This should read::
> 
>     try:
>         (...)
>     except:
>         os.remove(dictpath)
>         raise

Perhaps:

    try :
        (...)
    except :
        try :
            os.remove(dictpath)
        except :
            pass
        #end try
        raise
    #end try

(Just in case.)



More information about the Python-list mailing list