[pypy-svn] r60134 - pypy/trunk/pypy/rpython
arigo at codespeak.net
arigo at codespeak.net
Tue Nov 25 15:07:48 CET 2008
Author: arigo
Date: Tue Nov 25 15:07:48 2008
New Revision: 60134
Modified:
pypy/trunk/pypy/rpython/error.py
pypy/trunk/pypy/rpython/rtyper.py
Log:
Tentatively port the fix in the oo-jit branch:
show the graph of the error in TyperError.
Modified: pypy/trunk/pypy/rpython/error.py
==============================================================================
--- pypy/trunk/pypy/rpython/error.py (original)
+++ pypy/trunk/pypy/rpython/error.py Tue Nov 25 15:07:48 2008
@@ -3,7 +3,7 @@
def __str__(self):
result = Exception.__str__(self)
if hasattr(self, 'where'):
- result += '\n.. %r\n.. %r' % self.where
+ result += '\n.. %s\n.. %r\n.. %r' % self.where
return result
class MissingRTypeOperation(TyperError):
Modified: pypy/trunk/pypy/rpython/rtyper.py
==============================================================================
--- pypy/trunk/pypy/rpython/rtyper.py (original)
+++ pypy/trunk/pypy/rpython/rtyper.py Tue Nov 25 15:07:48 2008
@@ -259,8 +259,7 @@
if minimize and isinstance(err, BrokenReprTyperError):
bc += 1
continue
- block, position = err.where
- graph = self.annotator.annotated.get(block, None)
+ graph, block, position = err.where
errmsg = ("TyperError-%d: %s\n" % (c, graph) +
str(err) +
"\n")
@@ -525,7 +524,8 @@
"""Record a TyperError without crashing immediately.
Put a 'TyperError' operation in the graph instead.
"""
- e.where = (block, position)
+ graph = self.annotator.annotated.get(block)
+ e.where = (graph, block, position)
self.typererror_count += 1
if self.crash_on_first_typeerror:
raise
More information about the Pypy-commit
mailing list