How robust is Python ?

Moshe Zadka moshez at zadka.site.co.il
Sat Jan 13 04:36:45 EST 2001


On Fri, 12 Jan 2001, "Sandipan Gangopadhyay" <sandipan at vsnl.com> wrote:

> If I try a catch-all except, continue hits except on the outer level rather
> than while. Probably the reason that it results in syntax error.
> 
> while binAliveMarker:
>   try:
>     if binWannaStartAgainLater:
>       time.sleep(1)
>       continue
>     work code ...
>   except:
>     pass
> 
> Any suggestions to make it work with continue (or an alternative) ? Apart
> from removing continue completely by making the work code inside an else ?

I'm afraid that's your only alternative, unless you can afford to wait
for Python 2.1 or switch to JPython, both of which support continue
inside a try clause.
-- 
Moshe Zadka <sig at zadka.site.co.il>
This is a signature anti-virus. 
Please stop the spread of signature viruses!




More information about the Python-list mailing list