Use unicode for password modules
This commit is contained in:
parent
6e024b3842
commit
eb8b3a6d61
|
@ -46,10 +46,10 @@ static int initialized;
|
||||||
static PyTypeObject StructPwdType;
|
static PyTypeObject StructPwdType;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sets(PyObject *v, int i, char* val)
|
sets(PyObject *v, int i, const char* val)
|
||||||
{
|
{
|
||||||
if (val)
|
if (val)
|
||||||
PyStructSequence_SET_ITEM(v, i, PyString_FromString(val));
|
PyStructSequence_SET_ITEM(v, i, PyUnicode_FromString(val));
|
||||||
else {
|
else {
|
||||||
PyStructSequence_SET_ITEM(v, i, Py_None);
|
PyStructSequence_SET_ITEM(v, i, Py_None);
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
|
|
|
@ -57,10 +57,10 @@ static PyTypeObject StructSpwdType;
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sets(PyObject *v, int i, char* val)
|
sets(PyObject *v, int i, const char* val)
|
||||||
{
|
{
|
||||||
if (val)
|
if (val)
|
||||||
PyStructSequence_SET_ITEM(v, i, PyString_FromString(val));
|
PyStructSequence_SET_ITEM(v, i, PyUnicode_FromString(val));
|
||||||
else {
|
else {
|
||||||
PyStructSequence_SET_ITEM(v, i, Py_None);
|
PyStructSequence_SET_ITEM(v, i, Py_None);
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
|
|
Loading…
Reference in New Issue