Fixed test_urllibnet

This commit is contained in:
Christian Heimes 2008-01-27 15:45:24 +00:00
parent 7e182548fa
commit 061ce7fda7

View File

@ -13,10 +13,12 @@ import mimetools
def _open_with_retry(func, host, *args, **kwargs): def _open_with_retry(func, host, *args, **kwargs):
# Connecting to remote hosts is flaky. Make it more robust # Connecting to remote hosts is flaky. Make it more robust
# by retrying the connection several times. # by retrying the connection several times.
last_exc = None
for i in range(3): for i in range(3):
try: try:
return func(host, *args, **kwargs) return func(host, *args, **kwargs)
except IOError, last_exc: except IOError as err:
last_exc = err
continue continue
except: except:
raise raise