diff options
Diffstat (limited to 'scratch.py')
-rw-r--r-- | scratch.py | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -1,4 +1,5 @@ import sys +import time class Baz: def hello(self): @@ -9,4 +10,17 @@ if True: print("hello, {0}".format('world!')) c = Baz() -c.hello()
\ No newline at end of file +c.hello() + + + +success = False +retry = 3 +while not success and retry > 0: + try: + #raise Exception('my') + success = True + except Exception as e: + print(e, file=sys.stderr) + time.sleep(1) + retry = retry - 1
\ No newline at end of file |