mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-01 01:44:07 +03:00
Using 'Text_FromUTF8' macro for transforming the encrypted C string to
Python string to make it Python 3 compatible.
This commit is contained in:
parent
cfb0937605
commit
78eb80d0cf
|
@ -575,8 +575,8 @@ psyco_encrypt_password(connectionObject *self, PyObject *args, PyObject *kwargs)
|
||||||
|
|
||||||
if (encrypted != NULL)
|
if (encrypted != NULL)
|
||||||
{
|
{
|
||||||
res = PyString_FromString(encrypted);
|
res = Text_FromUTF8(encrypted);
|
||||||
free(encrypted);
|
PQfreemem(encrypted);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -600,10 +600,11 @@ psyco_encrypt_password(connectionObject *self, PyObject *args, PyObject *kwargs)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res = PyString_FromString(encrypted);
|
res = Text_FromUTF8(encrypted);
|
||||||
|
PQfreemem(encrypted);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
PyErr_SetString(
|
PyErr_SetString(
|
||||||
NotSupportedError,
|
NotSupportedError,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user