Commit e3e3701f authored by Guido van Rossum's avatar Guido van Rossum

Fix issue # 1037 (sort of).

parent 18c3ff88
...@@ -1080,8 +1080,14 @@ indenterror(struct tok_state *tok) ...@@ -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;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment