def urlretrieve(*largs, **kwargs): for i in range(5): try: return pyurlretrieve(*largs, **kwargs) except IOError as e: print('{} failed "{}"'.format(largs[0], e)) if i != 4: print('Trying again') sleep(10) else: raise
def urlretrieve(*largs, **kwargs): for i in range(5): try: return pyurlretrieve(*largs, **kwargs) except IOError as e: print('{} failed "{}"'.format(largs[0], e)) if i != 4: print("Trying again") sleep(10) else: raise
def urlretrieve(*largs, **kwargs): for i in range(5): try: return pyurlretrieve(*largs, **kwargs) except IOError: sleep(60)