From: Georg Brandl Date: Sun, 11 May 2008 15:07:39 +0000 (+0000) Subject: #2816: clarify error messages for EOF while scanning strings. X-Git-Tag: v2.6b1~492 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b52a74b5171f66bf38f7373e50c8515f2e6ab587;p=python #2816: clarify error messages for EOF while scanning strings. --- diff --git a/Lib/test/test_eof.py b/Lib/test/test_eof.py index 4d4c03b9d7..763917f0df 100644 --- a/Lib/test/test_eof.py +++ b/Lib/test/test_eof.py @@ -6,7 +6,7 @@ from test import test_support class EOFTestCase(unittest.TestCase): def test_EOFC(self): - expect = "EOL while scanning single-quoted string (, line 1)" + expect = "EOL while scanning string literal (, 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 (, line 1)" + expect = ("EOF while scanning triple-quoted string literal " + "(, line 1)") try: eval("""'''this is a test""") except SyntaxError, msg: diff --git a/Python/pythonrun.c b/Python/pythonrun.c index e1483aafa3..faca12f9ad 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -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())