[Jython-checkins] jython: #1591: Interactive interpreter stuck on '...' loop

frank.wierzbicki jython-checkins at python.org
Fri Jun 20 17:19:12 CEST 2014


http://hg.python.org/jython/rev/a46979f3754d
changeset:   7306:a46979f3754d
user:        Peter Holloway <peter.holloway at diamond.ac.uk>
date:        Fri Jun 20 15:19:05 2014 +0000
summary:
  #1591: Interactive interpreter stuck on '...' loop

files:
  ACKNOWLEDGMENTS         |  1 +
  Lib/test/test_codeop.py |  3 +++
  NEWS                    |  1 +
  grammar/PythonPartial.g |  2 +-
  4 files changed, 6 insertions(+), 1 deletions(-)


diff --git a/ACKNOWLEDGMENTS b/ACKNOWLEDGMENTS
--- a/ACKNOWLEDGMENTS
+++ b/ACKNOWLEDGMENTS
@@ -109,6 +109,7 @@
     Michael Büsch
     Richard Eckart de Castilho
     Timothée Lecomte
+    Peter Holloway
 
 Local Variables:
 mode: indented-text
diff --git a/Lib/test/test_codeop.py b/Lib/test/test_codeop.py
--- a/Lib/test/test_codeop.py
+++ b/Lib/test/test_codeop.py
@@ -302,6 +302,9 @@
             ai("[i for i in range(10)] = (1, 2, 3)")
             ai("a = 1 and b = 2");
 
+        # Merge test cases below upstream.
+        ai("def x():\n pass\na=1\n")
+
     def test_filename(self):
         self.assertEquals(compile_command("a = 1\n", "abc").co_filename,
                           compile("a = 1\n", "abc", 'single').co_filename)
diff --git a/NEWS b/NEWS
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@
     - [ 1981 ] ast.And and ast.Or should be subclasses of ast.boolop
   New Features
     - [ 1896215 ] findResource(s) for SyspathJavaLoader
+    - [ 1591 ] Interactive interpreter stuck on '...' loop
 
 Jython 2.7b2
   Bugs Fixed
diff --git a/grammar/PythonPartial.g b/grammar/PythonPartial.g
--- a/grammar/PythonPartial.g
+++ b/grammar/PythonPartial.g
@@ -167,7 +167,7 @@
 
     : NEWLINE
     | simple_stmt
-    | compound_stmt NEWLINE?
+    | compound_stmt NEWLINE? EOF
     ;
 
 //eval_input: testlist NEWLINE* ENDMARKER

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list