From 061ce7fda739a2711245cb121ef410ddf70a784c Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Sun, 27 Jan 2008 15:45:24 +0000 Subject: Fixed test_urllibnet --- Lib/test/test_urllibnet.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v0.12