mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-26 10:53:44 +03:00
We don't need to expose cursor_init(), call tp_init() on the type instead.
This commit is contained in:
parent
da6e061ee8
commit
1d52f34e60
|
@ -90,14 +90,11 @@ struct cursorObject {
|
|||
|
||||
|
||||
/* C-callable functions in cursor_int.c and cursor_type.c */
|
||||
HIDDEN int cursor_init(PyObject *obj, PyObject *args, PyObject *kwargs);
|
||||
|
||||
BORROWED HIDDEN PyObject *curs_get_cast(cursorObject *self, PyObject *oid);
|
||||
HIDDEN void curs_reset(cursorObject *self);
|
||||
HIDDEN int psyco_curs_withhold_set(cursorObject *self, PyObject *pyvalue);
|
||||
HIDDEN int psyco_curs_scrollable_set(cursorObject *self, PyObject *pyvalue);
|
||||
|
||||
|
||||
/* exception-raising macros */
|
||||
#define EXC_IF_CURS_CLOSED(self) \
|
||||
do { \
|
||||
|
|
|
@ -1901,7 +1901,7 @@ cursor_dealloc(PyObject* obj)
|
|||
Py_TYPE(obj)->tp_free(obj);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
cursor_init(PyObject *obj, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
PyObject *conn;
|
||||
|
|
|
@ -244,8 +244,10 @@ static struct PyGetSetDef replicationCursorObject_getsets[] = {
|
|||
};
|
||||
|
||||
static int
|
||||
replicationCursor_setup(replicationCursorObject* self)
|
||||
replicationCursor_init(PyObject *obj, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
replicationCursorObject *self = (replicationCursorObject *)obj;
|
||||
|
||||
self->started = 0;
|
||||
self->consuming = 0;
|
||||
self->decode = 0;
|
||||
|
@ -254,14 +256,7 @@ replicationCursor_setup(replicationCursorObject* self)
|
|||
self->flush_lsn = 0;
|
||||
self->apply_lsn = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
replicationCursor_init(PyObject *obj, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
replicationCursor_setup((replicationCursorObject *)obj);
|
||||
return cursor_init(obj, args, kwargs);
|
||||
return cursorType.tp_init(obj, args, kwargs);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
|
|
Loading…
Reference in New Issue
Block a user