Commits

Ronan Lamy committed 67c63d7

Inline format_global_error() into FlowingError.__str__()

  • Participants
  • Parent commits 7c12d65
  • Branches translation-cleanup

Comments (0)

Files changed (2)

File pypy/objspace/flow/flowcontext.py

 import collections
 import sys
-from pypy.tool.error import format_global_error
+from pypy.tool.error import source_lines
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.pytraceback import PyTraceback
 from pypy.interpreter import pyframe
         self.frame = frame
 
     def __str__(self):
-        return format_global_error(self.frame.graph, self.frame.last_instr,
-                str(self.msg))
+        msg = ['-+' * 30]
+        msg += map(str, self.args)
+        msg += source_lines(self.frame.graph, None, offset=self.frame.last_instr)
+        return "\n".join(msg)
 
 
 class StopFlowing(Exception):

File pypy/tool/error.py

     msg.append("  " + str(binding))
     return "\n".join(msg)
 
-def format_global_error(graph, offset, message):
-    msg = []
-    msg.append('-+' * 30)
-    msg.append(message)
-    msg += source_lines(graph, None, offset=offset)
-    return "\n".join(msg)
-
 def debug(drv, use_pdb=True):
     # XXX unify some code with pypy.translator.goal.translate
     from pypy.translator.tool.pdbplus import PdbPlusShow