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
cb6baff8e0
commit
e8fb84306d
|
@ -1824,6 +1824,13 @@ cursor_init(PyObject *obj, PyObject *args, PyObject *kwargs)
|
|||
if (name == Py_None) {
|
||||
cname = NULL;
|
||||
} 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))) {
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user