diff options
-rw-r--r-- | Lib/test/test_urllibnet.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py index c9a483a..e9f1fea 100644 --- a/Lib/test/test_urllibnet.py +++ b/Lib/test/test_urllibnet.py @@ -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 |