[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


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?


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
-------------- 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