From: Jeffrey Yasskin Date: Fri, 28 Mar 2008 04:53:10 +0000 (+0000) Subject: Print more information the next time test_socket throws the wrong exception. X-Git-Tag: v2.6a2~68 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=36550bdde947ef7cad57d1375fbcf6096b017231;p=python Print more information the next time test_socket throws the wrong exception. --- diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 660d85355f..614096228a 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: