mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
merge 3.4 (#24022)
This commit is contained in:
commit
273a720f87
3 changed files with 18 additions and 5 deletions
|
@ -1307,6 +1307,8 @@ verify_identifier(struct tok_state *tok)
|
|||
{
|
||||
PyObject *s;
|
||||
int result;
|
||||
if (tok->decoding_erred)
|
||||
return 0;
|
||||
s = PyUnicode_DecodeUTF8(tok->start, tok->cur - tok->start, NULL);
|
||||
if (s == NULL || PyUnicode_READY(s) == -1) {
|
||||
if (PyErr_ExceptionMatches(PyExc_UnicodeDecodeError)) {
|
||||
|
@ -1475,11 +1477,8 @@ tok_get(struct tok_state *tok, char **p_start, char **p_end)
|
|||
c = tok_nextc(tok);
|
||||
}
|
||||
tok_backup(tok, c);
|
||||
if (nonascii &&
|
||||
!verify_identifier(tok)) {
|
||||
tok->done = E_IDENTIFIER;
|
||||
if (nonascii && !verify_identifier(tok))
|
||||
return ERRORTOKEN;
|
||||
}
|
||||
*p_start = tok->start;
|
||||
*p_end = tok->cur;
|
||||
return NAME;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue