[Tutor] Pythonic way to "try a few times, then raise exception"?

Allen Fowler allen.fowler at yahoo.com
Fri Oct 26 20:13:10 CEST 2007


Hello,

I have a block of code buried deep in a module  that I expect to fail periodically. (Calls to other machines over slow network, and such.)

Generally, though,  trying it a second / third will work.

Is there clean way to write this on Python?

Thanks

 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20071026/9cb13de5/attachment.htm 


More information about the Tutor mailing list