mirror of
https://github.com/python/cpython.git
synced 2024-11-25 10:54:51 +08:00
Fix issue # 1037 (sort of).
This commit is contained in:
parent
18c3ff887f
commit
e3e3701f8f
@ -1080,8 +1080,14 @@ indenterror(struct tok_state *tok)
|
||||
static int
|
||||
verify_identifier(char *start, char *end)
|
||||
{
|
||||
PyObject *s = PyUnicode_DecodeUTF8(start, end-start, NULL);
|
||||
int result = PyUnicode_IsIdentifier(s);
|
||||
PyObject *s;
|
||||
int result;
|
||||
s = PyUnicode_DecodeUTF8(start, end-start, NULL);
|
||||
if (s == NULL) {
|
||||
PyErr_Clear();
|
||||
return 0;
|
||||
}
|
||||
result = PyUnicode_IsIdentifier(s);
|
||||
Py_DECREF(s);
|
||||
return result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user