]> granicus.if.org Git - python/commitdiff
Fixed test_urllibnet
authorChristian Heimes <christian@cheimes.de>
Sun, 27 Jan 2008 15:45:24 +0000 (15:45 +0000)
committerChristian Heimes <christian@cheimes.de>
Sun, 27 Jan 2008 15:45:24 +0000 (15:45 +0000)
Lib/test/test_urllibnet.py

index c9a483a962b253e53fc8387c9cfc8afd926991ec..e9f1fea91a26cdd7ed033443c33223729f8f01a7 100644 (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