Fix issue # 1037 (sort of).
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index 6320f75..d86615f 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -1080,8 +1080,14 @@
 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;
 }