@@ -23,14 +23,14 @@ Noddy_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
2323
2424 self = (Noddy * )type -> tp_alloc (type , 0 );
2525 if (self != NULL ) {
26- self -> first = PyString_FromString ("" );
26+ self -> first = PyUnicode_FromString ("" );
2727 if (self -> first == NULL )
2828 {
2929 Py_DECREF (self );
3030 return NULL ;
3131 }
3232
33- self -> last = PyString_FromString ("" );
33+ self -> last = PyUnicode_FromString ("" );
3434 if (self -> last == NULL )
3535 {
3636 Py_DECREF (self );
@@ -93,7 +93,7 @@ Noddy_setfirst(Noddy *self, PyObject *value, void *closure)
9393 return -1 ;
9494 }
9595
96- if (! PyString_Check (value )) {
96+ if (! PyUnicode_Check (value )) {
9797 PyErr_SetString (PyExc_TypeError ,
9898 "The first attribute value must be a string" );
9999 return -1 ;
@@ -121,7 +121,7 @@ Noddy_setlast(Noddy *self, PyObject *value, void *closure)
121121 return -1 ;
122122 }
123123
124- if (! PyString_Check (value )) {
124+ if (! PyUnicode_Check (value )) {
125125 PyErr_SetString (PyExc_TypeError ,
126126 "The last attribute value must be a string" );
127127 return -1 ;
@@ -153,7 +153,7 @@ Noddy_name(Noddy* self)
153153 PyObject * args , * result ;
154154
155155 if (format == NULL ) {
156- format = PyString_FromString ("%s %s" );
156+ format = PyUnicode_FromString ("%s %s" );
157157 if (format == NULL )
158158 return NULL ;
159159 }
@@ -162,7 +162,7 @@ Noddy_name(Noddy* self)
162162 if (args == NULL )
163163 return NULL ;
164164
165- result = PyString_Format (format , args );
165+ result = PyUnicode_Format (format , args );
166166 Py_DECREF (args );
167167
168168 return result ;
0 commit comments