From: Guido van Rossum Date: Wed, 29 Aug 2007 18:54:41 +0000 (+0000) Subject: Fix issue # 1037 (sort of). X-Git-Tag: v3.0a1~127 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e3e3701f8f1a3c9a4ae84cde793e421ce0460d83;p=thirdparty%2FPython%2Fcpython.git Fix issue # 1037 (sort of). --- diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 6320f7580acd..d86615faf82c 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -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; }