diff options
author | Jeffrey Yasskin <jyasskin@gmail.com> | 2008-03-28 04:53:10 (GMT) |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@gmail.com> | 2008-03-28 04:53:10 (GMT) |
commit | 36550bdde947ef7cad57d1375fbcf6096b017231 (patch) | |
tree | 0c2fe057e5530fe6d1ff030426737dbae9f58d52 /Lib/test/test_socket.py | |
parent | 023cd00ccc9bae7b26ad2dfd7b2d887c2f7b8e3d (diff) | |
download | cpython-36550bdde947ef7cad57d1375fbcf6096b017231.zip cpython-36550bdde947ef7cad57d1375fbcf6096b017231.tar.gz cpython-36550bdde947ef7cad57d1375fbcf6096b017231.tar.bz2 |
Print more information the next time test_socket throws the wrong exception.
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r-- | Lib/test/test_socket.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 660d853..6140962 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -5,8 +5,9 @@ from test import test_support import socket import select -import time import thread, threading +import time +import traceback import Queue import sys import os @@ -986,10 +987,13 @@ class TCPTimeoutTest(SocketTCPTest): except Alarm: pass 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: self.fail("nothing caught") - signal.alarm(0) # shut off alarm + finally: + signal.alarm(0) # shut off alarm except Alarm: self.fail("got Alarm in wrong place") finally: |