[pypy-svn] r7305 - pypy/trunk/src/pypy/translator

arigo at codespeak.net arigo at codespeak.net
Tue Nov 16 19:05:42 CET 2004


Author: arigo
Date: Tue Nov 16 19:05:40 2004
New Revision: 7305

Modified:
   pypy/trunk/src/pypy/translator/annrpython.py
Log:
Debugging help: print the reason why blocks remain blocked.


Modified: pypy/trunk/src/pypy/translator/annrpython.py
==============================================================================
--- pypy/trunk/src/pypy/translator/annrpython.py	(original)
+++ pypy/trunk/src/pypy/translator/annrpython.py	Tue Nov 16 19:05:40 2004
@@ -110,6 +110,16 @@
             fn, block, cells = self.pendingblocks.pop()
             self.processblock(fn, block, cells)
         if False in self.annotated.values():
+            for block in self.annotated:
+                if self.annotated[block] is False:
+                    import traceback
+                    print '-+' * 30
+                    print 'BLOCKED block at:',
+                    print self.why_not_annotated[block][1].break_at
+                    print 'because of:'
+                    traceback.print_exception(*self.why_not_annotated[block])
+                    print '-+' * 30
+                    print
             raise AnnotatorError('%d blocks are still blocked' %
                                  self.annotated.values().count(False))
 
@@ -256,7 +266,7 @@
                 #traceback.print_tb(sys.exc_info()[2])
                 self.annotated[block] = False   # failed, hopefully temporarily
                 import sys
-                self.why_not_annotated[block] = sys.exc_info()[2]
+                self.why_not_annotated[block] = sys.exc_info()
             except Exception, e:
                 # hack for debug tools only
                 if not hasattr(e, '__annotator_block'):



More information about the Pypy-commit mailing list