Kaydet (Commit) 36550bdd authored tarafından Jeffrey Yasskin's avatar Jeffrey Yasskin

Print more information the next time test_socket throws the wrong exception.

üst 023cd00c
...@@ -5,8 +5,9 @@ from test import test_support ...@@ -5,8 +5,9 @@ from test import test_support
import socket import socket
import select import select
import time
import thread, threading import thread, threading
import time
import traceback
import Queue import Queue
import sys import sys
import os import os
...@@ -986,10 +987,13 @@ class TCPTimeoutTest(SocketTCPTest): ...@@ -986,10 +987,13 @@ class TCPTimeoutTest(SocketTCPTest):
except Alarm: except Alarm:
pass pass
except: except:
self.fail("caught other exception instead of Alarm") self.fail("caught other exception instead of Alarm:"
" %s(%s):\n%s" %
(sys.exc_info()[:2] + (traceback.format_exc(),)))
else: else:
self.fail("nothing caught") self.fail("nothing caught")
signal.alarm(0) # shut off alarm finally:
signal.alarm(0) # shut off alarm
except Alarm: except Alarm:
self.fail("got Alarm in wrong place") self.fail("got Alarm in wrong place")
finally: finally:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment