diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2008-01-26 19:49:41 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2008-01-26 19:49:41 (GMT) |
commit | 2f1425819667cc4a2e87f6843e2fbf920953cd6b (patch) | |
tree | 25c04b17f101f38372bd669c38d499b568ce2c5c /Lib/test | |
parent | e3777b4e92a0d0267f4556e1ba40a5d6b5c601b8 (diff) | |
download | cpython-2f1425819667cc4a2e87f6843e2fbf920953cd6b.zip cpython-2f1425819667cc4a2e87f6843e2fbf920953cd6b.tar.gz cpython-2f1425819667cc4a2e87f6843e2fbf920953cd6b.tar.bz2 |
Get this test to pass
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_urllib2net.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py index 109dd1b..dc3d884 100644 --- a/Lib/test/test_urllib2net.py +++ b/Lib/test/test_urllib2net.py @@ -17,7 +17,8 @@ def _urlopen_with_retry(host, *args, **kwargs): for i in range(3): try: return urllib2.urlopen(host, *args, **kwargs) - except urllib2.URLError as last_exc: + except urllib2.URLError as e: + last_exc = e continue except: raise @@ -310,13 +311,13 @@ class TimeoutTest(unittest.TestCase): socket.setdefaulttimeout(60) try: u = _urlopen_with_retry(self.FTP_HOST, timeout=None) - self.assertEqual(u.fp.fp._sock.gettimeout(), 60) + self.assertEqual(u.fp.fp.raw._sock.gettimeout(), 60) finally: socket.setdefaulttimeout(prev) def test_ftp_NoneNodefault(self): u = _urlopen_with_retry(self.FTP_HOST, timeout=None) - self.assertTrue(u.fp.fp._sock.gettimeout() is None) + self.assertTrue(u.fp.fp.raw._sock.gettimeout() is None) def test_ftp_Value(self): u = _urlopen_with_retry(self.FTP_HOST, timeout=60) |