[pypy-svn] r16611 - in pypy/dist/pypy/interpreter: pyparser test

arigo at codespeak.net arigo at codespeak.net
Fri Aug 26 13:56:30 CEST 2005


Author: arigo
Date: Fri Aug 26 13:56:30 2005
New Revision: 16611

Modified:
   pypy/dist/pypy/interpreter/pyparser/pythonparse.py
   pypy/dist/pypy/interpreter/test/test_compiler.py
   pypy/dist/pypy/interpreter/test/test_exec.py
Log:
Some more pushing-and-pulling to make the interactive command line behave.


Modified: pypy/dist/pypy/interpreter/pyparser/pythonparse.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/pythonparse.py	(original)
+++ pypy/dist/pypy/interpreter/pyparser/pythonparse.py	Fri Aug 26 13:56:30 2005
@@ -31,9 +31,6 @@
         if textsrc.endswith('\n'):
             lines.pop()
             flags &= ~PyCF_DONT_IMPLY_DEDENT
-        else:
-            last_line = lines[-1]
-            lines[-1] = last_line[:-1]
         return self.parse_lines(lines, goal, builder, flags)
 
     def parse_lines(self, lines, goal, builder, flags=0):

Modified: pypy/dist/pypy/interpreter/test/test_compiler.py
==============================================================================
--- pypy/dist/pypy/interpreter/test/test_compiler.py	(original)
+++ pypy/dist/pypy/interpreter/test/test_compiler.py	Fri Aug 26 13:56:30 2005
@@ -27,9 +27,13 @@
             c0 = self.compiler.compile_command('\t # hello\n ', '?', mode, 0)
             c1 = self.compiler.compile_command('print 6*7', '?', mode, 0)
             c2 = self.compiler.compile_command('if 1:\n  x\n', '?', mode, 0)
+            c8 = self.compiler.compile_command('x = 5', '?', mode, 0)
+            c9 = self.compiler.compile_command('x = 5 ', '?', mode, 0)
             assert c0 is not None
             assert c1 is not None
             assert c2 is not None
+            assert c8 is not None
+            assert c9 is not None
             c3 = self.compiler.compile_command('if 1:\n  x', '?', mode, 0)
             c4 = self.compiler.compile_command('x = (', '?', mode, 0)
             c5 = self.compiler.compile_command('x = (\n', '?', mode, 0)

Modified: pypy/dist/pypy/interpreter/test/test_exec.py
==============================================================================
--- pypy/dist/pypy/interpreter/test/test_exec.py	(original)
+++ pypy/dist/pypy/interpreter/test/test_exec.py	Fri Aug 26 13:56:30 2005
@@ -169,3 +169,8 @@
         """ in d
         res = d['f']()
         assert res == (3, 2)
+
+    def test_space_bug(self):
+        d = {}
+        exec "x=5 " in d
+        assert d['x'] == 5



More information about the Pypy-commit mailing list