From e4dc32488446240942123cf4e9e7296ad97e20bf Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Sat, 25 Aug 2007 01:33:49 +0000 Subject: Use unicode for AST attributes --- Parser/asdl_c.py | 4 ++-- Python/Python-ast.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index 8c33e9d..2366b1a 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -408,7 +408,7 @@ static PyTypeObject* make_type(char *type, PyTypeObject* base, char**fields, int Py_INCREF(Py_None); } for(i=0; i < num_fields; i++) { - PyObject *field = PyString_FromString(fields[i]); + PyObject *field = PyUnicode_FromString(fields[i]); if (!field) { Py_DECREF(fnames); return NULL; @@ -427,7 +427,7 @@ static int add_attributes(PyTypeObject* type, char**attrs, int num_fields) PyObject *s, *l = PyList_New(num_fields); if (!l) return 0; for(i = 0; i < num_fields; i++) { - s = PyString_FromString(attrs[i]); + s = PyUnicode_FromString(attrs[i]); if (!s) { Py_DECREF(l); return 0; diff --git a/Python/Python-ast.c b/Python/Python-ast.c index ee1973a..605a152 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -404,7 +404,7 @@ static PyTypeObject* make_type(char *type, PyTypeObject* base, char**fields, int Py_INCREF(Py_None); } for(i=0; i < num_fields; i++) { - PyObject *field = PyString_FromString(fields[i]); + PyObject *field = PyUnicode_FromString(fields[i]); if (!field) { Py_DECREF(fnames); return NULL; @@ -423,7 +423,7 @@ static int add_attributes(PyTypeObject* type, char**attrs, int num_fields) PyObject *s, *l = PyList_New(num_fields); if (!l) return 0; for(i = 0; i < num_fields; i++) { - s = PyString_FromString(attrs[i]); + s = PyUnicode_FromString(attrs[i]); if (!s) { Py_DECREF(l); return 0; -- cgit v0.12