]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Skip test if socket gets reset, the problem is on the other side.
authorNeal Norwitz <nnorwitz@gmail.com>
Mon, 24 Mar 2008 05:51:45 +0000 (05:51 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Mon, 24 Mar 2008 05:51:45 +0000 (05:51 +0000)
Lib/test/test_xmlrpc_net.py

index 4751d572538b1bf350064cd62902061b1dc4fef4..260bc240a6beccfcfc98f6e2a0b2a1b0c6a399fa 100644 (file)
@@ -1,5 +1,8 @@
 #!/usr/bin/env python
 
+import errno
+import socket
+import sys
 import unittest
 from test import test_support
 
@@ -11,7 +14,14 @@ class CurrentTimeTest(unittest.TestCase):
         # Get the current time from xmlrpc.com.  This code exercises
         # the minimal HTTP functionality in xmlrpclib.
         server = xmlrpclib.ServerProxy("http://time.xmlrpc.com/RPC2")
-        t0 = server.currentTime.getCurrentTime()
+        try:
+            t0 = server.currentTime.getCurrentTime()
+        except socket.error as e:
+            if e.errno != errno.ECONNRESET:
+                raise
+            print("    test_current_time: socket got reset, skipping test",
+                  file=sys.stderr)
+            return
 
         # Perform a minimal sanity check on the result, just to be sure
         # the request means what we think it means.