Use unicode for AST attributes

This commit is contained in:
Neal Norwitz 2007-08-25 01:33:49 +00:00
parent aefab1e2ac
commit e4dc324884
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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;