]> granicus.if.org Git - python/commitdiff
Manual backport of r54233. This will help prevent spurious Buildbot failures
authorBrett Cannon <bcannon@gmail.com>
Fri, 9 Mar 2007 04:57:00 +0000 (04:57 +0000)
committerBrett Cannon <bcannon@gmail.com>
Fri, 9 Mar 2007 04:57:00 +0000 (04:57 +0000)
by HTTPS connections that time out.

Lib/test/test_socket_ssl.py
Misc/NEWS

index 3c9c9f03c0eb5ab4b73edb97c2efcaf071a199bc..ae6e1daaa10984eafc08ec6b2b7c6460c55445c5 100644 (file)
@@ -27,7 +27,13 @@ def test_basic():
         print "didn't raise TypeError"
     socket.RAND_add("this is a random string", 75.0)
 
-    f = urllib.urlopen('https://sf.net')
+    try:
+        f = urllib.urlopen('https://sf.net')
+    except IOError, exc:
+        if exc.errno == errno.ETIMEDOUT:
+            raise test_support.ResourceDenied('HTTPS connection is timing out')
+        else:
+            raise
     buf = f.read()
     f.close()
 
index 1ea491600bd948ceb6e14238dd7bc7e094ea787a..525c9bd9f08fe5f3aa2778b477db0552f9e23d63 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -356,6 +356,9 @@ Tools/Demos
 Tests
 -----
 
+- Cause test.test_socket_ssl:test_basic to raise
+  test.test_support.ResourceDenied when an HTTPS connection times out.
+
 - Remove passwd.adjunct.byname from list of maps
   for test_nis.