mirror of
https://github.com/python/cpython.git
synced 2025-11-11 14:44:57 +00:00
Fix issue # 1037 (sort of).
This commit is contained in:
parent
18c3ff887f
commit
e3e3701f8f
1 changed files with 8 additions and 2 deletions
|
|
@ -1080,8 +1080,14 @@ indenterror(struct tok_state *tok)
|
||||||
static int
|
static int
|
||||||
verify_identifier(char *start, char *end)
|
verify_identifier(char *start, char *end)
|
||||||
{
|
{
|
||||||
PyObject *s = PyUnicode_DecodeUTF8(start, end-start, NULL);
|
PyObject *s;
|
||||||
int result = PyUnicode_IsIdentifier(s);
|
int result;
|
||||||
|
s = PyUnicode_DecodeUTF8(start, end-start, NULL);
|
||||||
|
if (s == NULL) {
|
||||||
|
PyErr_Clear();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
result = PyUnicode_IsIdentifier(s);
|
||||||
Py_DECREF(s);
|
Py_DECREF(s);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue