mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 17:34:08 +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)
|
||||
{
|
||||
res = PyString_FromString(encrypted);
|
||||
free(encrypted);
|
||||
res = Text_FromUTF8(encrypted);
|
||||
PQfreemem(encrypted);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
@ -600,10 +600,11 @@ psyco_encrypt_password(connectionObject *self, PyObject *args, PyObject *kwargs)
|
|||
}
|
||||
else
|
||||
{
|
||||
res = PyString_FromString(encrypted);
|
||||
res = Text_FromUTF8(encrypted);
|
||||
PQfreemem(encrypted);
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
#else
|
||||
PyErr_SetString(
|
||||
NotSupportedError,
|
||||
|
|
Loading…
Reference in New Issue
Block a user