[pypy-svn] r15286 - pypy/dist/pypy/interpreter

arigo at codespeak.net arigo at codespeak.net
Thu Jul 28 20:58:22 CEST 2005


Author: arigo
Date: Thu Jul 28 20:58:20 2005
New Revision: 15286

Modified:
   pypy/dist/pypy/interpreter/error.py
   pypy/dist/pypy/interpreter/interactive.py
Log:
Restored the broken old hack that allows the interactive command-line to print
tracebacks showing lines from the interactively entered source code.


Modified: pypy/dist/pypy/interpreter/error.py
==============================================================================
--- pypy/dist/pypy/interpreter/error.py	(original)
+++ pypy/dist/pypy/interpreter/error.py	Thu Jul 28 20:58:20 2005
@@ -96,7 +96,7 @@
                     lines = fname.split('\n')
                     fname = lines[0].strip()
                     try:
-                        l = lines[lineno]
+                        l = lines[lineno+1]
                     except IndexError:
                         l = ''
                 else:

Modified: pypy/dist/pypy/interpreter/interactive.py
==============================================================================
--- pypy/dist/pypy/interpreter/interactive.py	(original)
+++ pypy/dist/pypy/interpreter/interactive.py	Thu Jul 28 20:58:20 2005
@@ -159,7 +159,8 @@
         raise NotImplementedError
 
     def runsource(self, source, ignored_filename="<input>", symbol="single"):
-        hacked_filename = '<inline>' + source
+        # the following hacked file name is recognized specially by error.py
+        hacked_filename = '<inline>\n' + source
         compiler = self.space.getexecutioncontext().compiler
         
         def doit():



More information about the Pypy-commit mailing list