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

This commit is contained in:
Jeffrey Yasskin 2008-03-28 04:53:10 +00:00
parent 023cd00ccc
commit 36550bdde9
1 changed files with 7 additions and 3 deletions

View File

@ -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,9 +987,12 @@ 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")
finally:
signal.alarm(0) # shut off alarm
except Alarm:
self.fail("got Alarm in wrong place")