@@ -27,7 +27,7 @@ static PyObject* PyXmlSec_Transform__str__(PyObject* self) {
2727 else
2828 snprintf (buf , sizeof (buf ), "%s, None" , transform -> id -> name );
2929
30- return PyString_FromString (buf );
30+ return PyUnicode_FromString (buf );
3131}
3232
3333// __repr__ method
@@ -38,18 +38,18 @@ static PyObject* PyXmlSec_Transform__repr__(PyObject* self) {
3838 snprintf (buf , sizeof (buf ), "__Transform('%s', '%s', %d)" , transform -> id -> name , transform -> id -> href , transform -> id -> usage );
3939 else
4040 snprintf (buf , sizeof (buf ), "__Transform('%s', None, %d)" , transform -> id -> name , transform -> id -> usage );
41- return PyString_FromString (buf );
41+ return PyUnicode_FromString (buf );
4242}
4343
4444static const char PyXmlSec_TransformNameGet__doc__ [] = "The transform's name." ;
4545static PyObject * PyXmlSec_TransformNameGet (PyXmlSec_Transform * self , void * closure ) {
46- return PyString_FromString ((const char * )self -> id -> name );
46+ return PyUnicode_FromString ((const char * )self -> id -> name );
4747}
4848
4949static const char PyXmlSec_TransformHrefGet__doc__ [] = "The transform's identification string (href)." ;
5050static PyObject * PyXmlSec_TransformHrefGet (PyXmlSec_Transform * self , void * closure ) {
5151 if (self -> id -> href != NULL )
52- return PyString_FromString ((const char * )self -> id -> href );
52+ return PyUnicode_FromString ((const char * )self -> id -> href );
5353 Py_RETURN_NONE ;
5454}
5555
@@ -149,7 +149,7 @@ static PyObject* PyXmlSec_KeyData__str__(PyObject* self) {
149149 snprintf (buf , sizeof (buf ), "%s, %s" , keydata -> id -> name , keydata -> id -> href );
150150 else
151151 snprintf (buf , sizeof (buf ), "%s, None" , keydata -> id -> name );
152- return PyString_FromString (buf );
152+ return PyUnicode_FromString (buf );
153153}
154154
155155// __repr__ method
@@ -160,18 +160,18 @@ static PyObject* PyXmlSec_KeyData__repr__(PyObject* self) {
160160 snprintf (buf , sizeof (buf ), "__KeyData('%s', '%s')" , keydata -> id -> name , keydata -> id -> href );
161161 else
162162 snprintf (buf , sizeof (buf ), "__KeyData('%s', None)" , keydata -> id -> name );
163- return PyString_FromString (buf );
163+ return PyUnicode_FromString (buf );
164164}
165165
166166static const char PyXmlSec_KeyDataNameGet__doc__ [] = "The key data's name." ;
167167static PyObject * PyXmlSec_KeyDataNameGet (PyXmlSec_KeyData * self , void * closure ) {
168- return PyString_FromString ((const char * )self -> id -> name );
168+ return PyUnicode_FromString ((const char * )self -> id -> name );
169169}
170170
171171static const char PyXmlSec_KeyDataHrefGet__doc__ [] = "The key data's identification string (href)." ;
172172static PyObject * PyXmlSec_KeyDataHrefGet (PyXmlSec_KeyData * self , void * closure ) {
173173 if (self -> id -> href != NULL )
174- return PyString_FromString ((const char * )self -> id -> href );
174+ return PyUnicode_FromString ((const char * )self -> id -> href );
175175 Py_RETURN_NONE ;
176176}
177177
@@ -308,7 +308,7 @@ int PyXmlSec_ConstantsModule_Init(PyObject* package) {
308308
309309
310310#define PYXMLSEC_ADD_NS_CONSTANT (name , lname ) \
311- tmp = PyString_FromString ((const char*)(JOIN(xmlSec, name))); \
311+ tmp = PyUnicode_FromString ((const char*)(JOIN(xmlSec, name))); \
312312 PYXMLSEC_ADD_CONSTANT(nsCls, name, lname);
313313
314314 // namespaces
@@ -334,7 +334,7 @@ int PyXmlSec_ConstantsModule_Init(PyObject* package) {
334334
335335
336336#define PYXMLSEC_ADD_ENC_CONSTANT (name , lname ) \
337- tmp = PyString_FromString ((const char*)(JOIN(xmlSec, name))); \
337+ tmp = PyUnicode_FromString ((const char*)(JOIN(xmlSec, name))); \
338338 PYXMLSEC_ADD_CONSTANT(encryptionTypeCls, name, lname);
339339
340340 // encryption type
@@ -349,7 +349,7 @@ int PyXmlSec_ConstantsModule_Init(PyObject* package) {
349349
350350
351351#define PYXMLSEC_ADD_NODE_CONSTANT (name , lname ) \
352- tmp = PyString_FromString ((const char*)(JOIN(xmlSec, name))); \
352+ tmp = PyUnicode_FromString ((const char*)(JOIN(xmlSec, name))); \
353353 PYXMLSEC_ADD_CONSTANT(nodeCls, name, lname);
354354
355355 // node
0 commit comments