mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-07 21:00:33 +03:00
Fixed cursor name as unicode string on Python 3
This commit is contained in:
parent
874a74fe94
commit
c7d1271ab4
|
@ -1824,6 +1824,13 @@ cursor_init(PyObject *obj, PyObject *args, PyObject *kwargs)
|
||||||
if (name == Py_None) {
|
if (name == Py_None) {
|
||||||
cname = NULL;
|
cname = NULL;
|
||||||
} else {
|
} else {
|
||||||
|
Py_INCREF(name); /* for ensure_bytes */
|
||||||
|
if (!(name = psycopg_ensure_bytes(name))) {
|
||||||
|
/* name has had a ref stolen */
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
Py_DECREF(name);
|
||||||
|
|
||||||
if (!(cname = Bytes_AsString(name))) {
|
if (!(cname = Bytes_AsString(name))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user