mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
provide less mysterious error messages when seeing end-of-line in
single-quoted strings or end-of-file in triple-quoted strings. closes patch 586561.
This commit is contained in:
parent
90e9a79afd
commit
118ec70ea2
3 changed files with 14 additions and 3 deletions
|
@ -1247,6 +1247,12 @@ err_input(perrdetail *err)
|
|||
case E_TOKEN:
|
||||
msg = "invalid token";
|
||||
break;
|
||||
case E_EOFS:
|
||||
msg = "EOF while scanning triple-quoted string";
|
||||
break;
|
||||
case E_EOLS:
|
||||
msg = "EOL while scanning single-quoted string";
|
||||
break;
|
||||
case E_INTR:
|
||||
PyErr_SetNone(PyExc_KeyboardInterrupt);
|
||||
Py_XDECREF(v);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue