Returning to 'try' block after catching an exception

alex23 wuwei23 at gmail.com
Wed May 21 21:05:11 EDT 2008


On May 22, 9:13 am, Karlo Lozovina <_karlo_ at _mosor.net_> wrote:
> In case it's not clear what I meant: after executing some_function()
> exception SomeExcpetion gets risen. Then, in except block I do something
> to fix whatever is causing the exception and then I would like to go back
> to try block, and execute some_function() again. Is that doable?

If you know what exception to expect, and you know how to "fix" the
cause, why not just put tests _before_ some_function() is called to
ensure that everything is as it needs to be?



More information about the Python-list mailing list