Commit f272643b authored by Neal Norwitz's avatar Neal Norwitz

Use unicode

parent b5d9f9fd
...@@ -146,7 +146,7 @@ get_handler_name(struct HandlerInfo *hinfo) ...@@ -146,7 +146,7 @@ get_handler_name(struct HandlerInfo *hinfo)
{ {
PyObject *name = hinfo->nameobj; PyObject *name = hinfo->nameobj;
if (name == NULL) { if (name == NULL) {
name = PyString_FromString(hinfo->name); name = PyUnicode_FromString(hinfo->name);
hinfo->nameobj = name; hinfo->nameobj = name;
} }
Py_XINCREF(name); Py_XINCREF(name);
...@@ -1408,7 +1408,7 @@ xmlparse_dir(PyObject *self, PyObject* noargs) ...@@ -1408,7 +1408,7 @@ xmlparse_dir(PyObject *self, PyObject* noargs)
{ {
#define APPEND(list, str) \ #define APPEND(list, str) \
do { \ do { \
PyObject *o = PyString_FromString(str); \ PyObject *o = PyUnicode_FromString(str); \
if (o != NULL) \ if (o != NULL) \
PyList_Append(list, o); \ PyList_Append(list, o); \
Py_XDECREF(o); \ Py_XDECREF(o); \
...@@ -1706,7 +1706,7 @@ get_version_string(void) ...@@ -1706,7 +1706,7 @@ get_version_string(void)
while (rev[i] != ' ' && rev[i] != '\0') while (rev[i] != ' ' && rev[i] != '\0')
++i; ++i;
return PyString_FromStringAndSize(rev, i); return PyUnicode_FromStringAndSize(rev, i);
} }
/* Initialization function for the module */ /* Initialization function for the module */
...@@ -1733,7 +1733,7 @@ PyMODINIT_FUNC ...@@ -1733,7 +1733,7 @@ PyMODINIT_FUNC
MODULE_INITFUNC(void) MODULE_INITFUNC(void)
{ {
PyObject *m, *d; PyObject *m, *d;
PyObject *errmod_name = PyString_FromString(MODULE_NAME ".errors"); PyObject *errmod_name = PyUnicode_FromString(MODULE_NAME ".errors");
PyObject *errors_module; PyObject *errors_module;
PyObject *modelmod_name; PyObject *modelmod_name;
PyObject *model_module; PyObject *model_module;
...@@ -1743,7 +1743,7 @@ MODULE_INITFUNC(void) ...@@ -1743,7 +1743,7 @@ MODULE_INITFUNC(void)
if (errmod_name == NULL) if (errmod_name == NULL)
return; return;
modelmod_name = PyString_FromString(MODULE_NAME ".model"); modelmod_name = PyUnicode_FromString(MODULE_NAME ".model");
if (modelmod_name == NULL) if (modelmod_name == NULL)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment