]> granicus.if.org Git - python/commitdiff
#2816: clarify error messages for EOF while scanning strings.
authorGeorg Brandl <georg@python.org>
Sun, 11 May 2008 15:07:39 +0000 (15:07 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 11 May 2008 15:07:39 +0000 (15:07 +0000)
Lib/test/test_eof.py
Python/pythonrun.c

index 4d4c03b9d7bcfb7145548241dce163ab66f6a86f..763917f0dfc5e9986c78ae7c26ba61679617c5d9 100644 (file)
@@ -6,7 +6,7 @@ from test import test_support
 
 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 @@ class EOFTestCase(unittest.TestCase):
             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:
index e1483aafa32827809500221384401f7d5bf5ba06..faca12f9ad200063fdef6ddf43610f74d0a0321f 100644 (file)
@@ -1500,10 +1500,10 @@ err_input(perrdetail *err)
                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())