[Python-checkins] r61986 - python/trunk/Lib/test/test_socket.py

jeffrey.yasskin python-checkins at python.org
Fri Mar 28 05:53:11 CET 2008


Author: jeffrey.yasskin
Date: Fri Mar 28 05:53:10 2008
New Revision: 61986

Modified:
   python/trunk/Lib/test/test_socket.py
Log:
Print more information the next time test_socket throws the wrong exception.


Modified: python/trunk/Lib/test/test_socket.py
==============================================================================
--- python/trunk/Lib/test/test_socket.py	(original)
+++ python/trunk/Lib/test/test_socket.py	Fri Mar 28 05:53:10 2008
@@ -5,8 +5,9 @@
 
 import socket
 import select
-import time
 import thread, threading
+import time
+import traceback
 import Queue
 import sys
 import os
@@ -986,10 +987,13 @@
             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:


More information about the Python-checkins mailing list