Fix issue # 1037 (sort of).

This commit is contained in:
Guido van Rossum 2007-08-29 18:54:41 +00:00
parent 18c3ff887f
commit e3e3701f8f
1 changed files with 8 additions and 2 deletions

View File

@ -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;
}