mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-04-28 12:13:42 +03:00
Attempt to enforce signature for the "O&" converter functions
It seems causing a traceback in the static checker. Enforcing it simplifies the code, but doesn't help the checker.
This commit is contained in:
parent
e1266d52cd
commit
4d15b973b0
|
@ -1261,8 +1261,8 @@ exit:
|
||||||
#define psyco_curs_copy_from_doc \
|
#define psyco_curs_copy_from_doc \
|
||||||
"copy_from(file, table, sep='\\t', null='\\\\N', size=8192, columns=None) -- Copy table from file."
|
"copy_from(file, table, sep='\\t', null='\\\\N', size=8192, columns=None) -- Copy table from file."
|
||||||
|
|
||||||
static int
|
STEALS(1) static int
|
||||||
_psyco_curs_has_read_check(PyObject* o, void* var)
|
_psyco_curs_has_read_check(PyObject *o, PyObject **var)
|
||||||
{
|
{
|
||||||
if (PyObject_HasAttrString(o, "readline")
|
if (PyObject_HasAttrString(o, "readline")
|
||||||
&& PyObject_HasAttrString(o, "read")) {
|
&& PyObject_HasAttrString(o, "read")) {
|
||||||
|
@ -1272,7 +1272,7 @@ _psyco_curs_has_read_check(PyObject* o, void* var)
|
||||||
* which could invoke the garbage collector. We thus need an
|
* which could invoke the garbage collector. We thus need an
|
||||||
* INCREF/DECREF pair if we store this pointer in a GC object, such as
|
* INCREF/DECREF pair if we store this pointer in a GC object, such as
|
||||||
* a cursorObject */
|
* a cursorObject */
|
||||||
*((PyObject**)var) = o;
|
*var = o;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1368,11 +1368,11 @@ exit:
|
||||||
#define psyco_curs_copy_to_doc \
|
#define psyco_curs_copy_to_doc \
|
||||||
"copy_to(file, table, sep='\\t', null='\\\\N', columns=None) -- Copy table to file."
|
"copy_to(file, table, sep='\\t', null='\\\\N', columns=None) -- Copy table to file."
|
||||||
|
|
||||||
static int
|
STEALS(1) static int
|
||||||
_psyco_curs_has_write_check(PyObject* o, void* var)
|
_psyco_curs_has_write_check(PyObject *o, PyObject **var)
|
||||||
{
|
{
|
||||||
if (PyObject_HasAttrString(o, "write")) {
|
if (PyObject_HasAttrString(o, "write")) {
|
||||||
*((PyObject**)var) = o;
|
*var = o;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user