[pypy-svn] r15479 - pypy/dist/pypy/translator/goal

hpk at codespeak.net hpk at codespeak.net
Sun Jul 31 17:16:35 CEST 2005


Author: hpk
Date: Sun Jul 31 17:16:34 2005
New Revision: 15479

Modified:
   pypy/dist/pypy/translator/goal/app_main.py
Log:
try to get a short traceback instead of waiting 
for the end of times trying to see the full traceback


Modified: pypy/dist/pypy/translator/goal/app_main.py
==============================================================================
--- pypy/dist/pypy/translator/goal/app_main.py	(original)
+++ pypy/dist/pypy/translator/goal/app_main.py	Sun Jul 31 17:16:34 2005
@@ -26,7 +26,15 @@
         typ, val, tb = excinfo 
         print >> sys.stderr, "exception-type:", typ.__name__
         print >> sys.stderr, "exception-value:", str(val)
-        sys.excepthook(typ, val, tb)
+        # print short tracebacks filename:lineno 
+        tbentry = tb
+        while tbentry: 
+            lineno = tbentry.tb_lineno 
+            filename = tbentry.tb_frame.f_code.co_filename
+            print >>sys.stderr, "  %s:%d" %(filename, lineno)
+            tbentry = tbentry.tb_next 
+        # then take forever trying to print a traceback ...
+        #sys.excepthook(typ, val, tb)
         return 1
     else:
         return 0



More information about the Pypy-commit mailing list