[or-cvs] r12349: This should /actually/ provide more detail. (weather/trunk)

pde at seul.org pde at seul.org
Fri Nov 2 23:34:59 UTC 2007


Author: pde
Date: 2007-11-02 19:34:59 -0400 (Fri, 02 Nov 2007)
New Revision: 12349

Modified:
   weather/trunk/poll.py
Log:
This should /actually/ provide more detail.



Modified: weather/trunk/poll.py
===================================================================
--- weather/trunk/poll.py	2007-11-02 20:21:26 UTC (rev 12348)
+++ weather/trunk/poll.py	2007-11-02 23:34:59 UTC (rev 12349)
@@ -7,7 +7,7 @@
 import time
 import threading
 from datetime import datetime
-from traceback import print_exception
+from traceback import format_exc
 from subprocess import Popen, PIPE
 import TorCtl.TorCtl as TorCtl
 
@@ -180,10 +180,10 @@
         pass
     except:
       # for /some/ reason, we can't contact this tor node
-      ex1,ex2,ex3 = sys.exc_info()
+      #ex1,ex2,ex3 = sys.exc_info()
       if self.internet_looks_okay():
         # But we can ping the net.  That's bad.
-        reason = print_exception(ex1,ex2,ex3)
+        reason = format_exc(500)    # limit to 500 stack levels in emails!
         if (debug):
           print "logging a strike against node", node, "because of:"
           print reason
@@ -191,7 +191,7 @@
       else:
         print "I would have concluded that tor node", node, "was down;"
         print "The problem looked like this:"
-        print print_exception(ex1,ex2,ex3)
+        print format_exc()
         print "But I couldn't ping %s!" % (self.ping_failure)
  
   good_ping = re.compile("0% packet loss")



More information about the tor-commits mailing list