[Python-checkins] r63068 - in python/trunk: Lib/test/test_eof.py Python/pythonrun.c

georg.brandl python-checkins at python.org
Sun May 11 17:07:39 CEST 2008


Author: georg.brandl
Date: Sun May 11 17:07:39 2008
New Revision: 63068

Log:
#2816: clarify error messages for EOF while scanning strings.


Modified:
   python/trunk/Lib/test/test_eof.py
   python/trunk/Python/pythonrun.c

Modified: python/trunk/Lib/test/test_eof.py
==============================================================================
--- python/trunk/Lib/test/test_eof.py	(original)
+++ python/trunk/Lib/test/test_eof.py	Sun May 11 17:07:39 2008
@@ -6,7 +6,7 @@
 
 class EOFTestCase(unittest.TestCase):
     def test_EOFC(self):
-        expect = "EOL while scanning single-quoted string (<string>, line 1)"
+        expect = "EOL while scanning string literal (<string>, line 1)"
         try:
             eval("""'this is a test\
             """)
@@ -16,7 +16,8 @@
             raise test_support.TestFailed
 
     def test_EOFS(self):
-        expect = "EOF while scanning triple-quoted string (<string>, line 1)"
+        expect = ("EOF while scanning triple-quoted string literal "
+                  "(<string>, line 1)")
         try:
             eval("""'''this is a test""")
         except SyntaxError, msg:

Modified: python/trunk/Python/pythonrun.c
==============================================================================
--- python/trunk/Python/pythonrun.c	(original)
+++ python/trunk/Python/pythonrun.c	Sun May 11 17:07:39 2008
@@ -1500,10 +1500,10 @@
 		msg = "invalid token";
 		break;
 	case E_EOFS:
-		msg = "EOF while scanning triple-quoted string";
+		msg = "EOF while scanning triple-quoted string literal";
 		break;
 	case E_EOLS:
-		msg = "EOL while scanning single-quoted string";
+		msg = "EOL while scanning string literal";
 		break;
 	case E_INTR:
 		if (!PyErr_Occurred())


More information about the Python-checkins mailing list