]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix issue # 1037 (sort of).
authorGuido van Rossum <guido@python.org>
Wed, 29 Aug 2007 18:54:41 +0000 (18:54 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 29 Aug 2007 18:54:41 +0000 (18:54 +0000)
Parser/tokenizer.c

index 6320f7580acd18c862a33485f7da5a91df2af9f3..d86615faf82cb5669b70d4ea29124a032fffbb3e 100644 (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;
 }