Author: guido.van.rossum
Date: Wed Aug 29 20:54:41 2007
New Revision: 57674

Modified:
   python/branches/py3k/Parser/tokenizer.c
Log:
Fix issue # 1037 (sort of).


Modified: python/branches/py3k/Parser/tokenizer.c
==============================================================================
--- python/branches/py3k/Parser/tokenizer.c     (original)
+++ python/branches/py3k/Parser/tokenizer.c     Wed Aug 29 20:54:41 2007
@@ -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;
 }
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to