diff options
Diffstat (limited to 'Python/Python-tokenize.c')
-rw-r--r-- | Python/Python-tokenize.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Python/Python-tokenize.c b/Python/Python-tokenize.c index 223de54..4d21793 100644 --- a/Python/Python-tokenize.c +++ b/Python/Python-tokenize.c @@ -84,13 +84,8 @@ _tokenizer_error(struct tok_state *tok) msg = "invalid token"; break; case E_EOF: - if (tok->level > 0) { - PyErr_Format(PyExc_SyntaxError, - "parenthesis '%c' was never closed", - tok->parenstack[tok->level-1]); - } else { - PyErr_SetString(PyExc_SyntaxError, "unexpected EOF while parsing"); - } + PyErr_SetString(PyExc_SyntaxError, "unexpected EOF in multi-line statement"); + PyErr_SyntaxLocationObject(tok->filename, tok->lineno, tok->inp - tok->buf < 0 ? 0 : tok->inp - tok->buf); return -1; case E_DEDENT: msg = "unindent does not match any outer indentation level"; |