Fixed test_urllibnet

This commit is contained in:
Christian Heimes 2008-01-27 15:45:24 +00:00
parent 7e182548fa
commit 061ce7fda7
1 changed files with 3 additions and 1 deletions

View File

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