diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2008-03-24 05:51:45 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2008-03-24 05:51:45 (GMT) |
commit | 64018ae0572044af8817a7096977792c0935ba7c (patch) | |
tree | 21807988e6155a511579785a3dfeec6007b39709 | |
parent | 22c6542691470f597fe639e9db4bfa17601d897f (diff) | |
download | cpython-64018ae0572044af8817a7096977792c0935ba7c.zip cpython-64018ae0572044af8817a7096977792c0935ba7c.tar.gz cpython-64018ae0572044af8817a7096977792c0935ba7c.tar.bz2 |
Skip test if socket gets reset, the problem is on the other side.
-rw-r--r-- | Lib/test/test_xmlrpc_net.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Lib/test/test_xmlrpc_net.py b/Lib/test/test_xmlrpc_net.py index 4751d57..260bc24 100644 --- a/Lib/test/test_xmlrpc_net.py +++ b/Lib/test/test_xmlrpc_net.py @@ -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. |