Skip to content

Commit

Permalink
Use unicode for AST attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
nnorwitz committed Aug 25, 2007
1 parent aefab1e commit e4dc324
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Parser/asdl_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def visitModule(self, mod):
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;
Expand All @@ -427,7 +427,7 @@ def visitModule(self, mod):
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;
Expand Down
4 changes: 2 additions & 2 deletions Python/Python-ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit e4dc324

Please sign in to comment.