bpo-33029: Fix signatures of getter and setter functions. (GH-10746)
Fix also return type for few other functions (clear, releasebuffer).
(cherry picked from commit d4f9cf5545
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
d669154ee5
commit
5ceb7018dc
|
@ -1094,7 +1094,7 @@ _asyncio_Future_get_loop_impl(FutureObj *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
FutureObj_get_blocking(FutureObj *fut)
|
FutureObj_get_blocking(FutureObj *fut, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (future_is_alive(fut) && fut->fut_blocking) {
|
if (future_is_alive(fut) && fut->fut_blocking) {
|
||||||
Py_RETURN_TRUE;
|
Py_RETURN_TRUE;
|
||||||
|
@ -1105,7 +1105,7 @@ FutureObj_get_blocking(FutureObj *fut)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
FutureObj_set_blocking(FutureObj *fut, PyObject *val)
|
FutureObj_set_blocking(FutureObj *fut, PyObject *val, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (future_ensure_alive(fut)) {
|
if (future_ensure_alive(fut)) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -1120,7 +1120,7 @@ FutureObj_set_blocking(FutureObj *fut, PyObject *val)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
FutureObj_get_log_traceback(FutureObj *fut)
|
FutureObj_get_log_traceback(FutureObj *fut, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
ENSURE_FUTURE_ALIVE(fut)
|
ENSURE_FUTURE_ALIVE(fut)
|
||||||
if (fut->fut_log_tb) {
|
if (fut->fut_log_tb) {
|
||||||
|
@ -1132,7 +1132,7 @@ FutureObj_get_log_traceback(FutureObj *fut)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
FutureObj_set_log_traceback(FutureObj *fut, PyObject *val)
|
FutureObj_set_log_traceback(FutureObj *fut, PyObject *val, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
int is_true = PyObject_IsTrue(val);
|
int is_true = PyObject_IsTrue(val);
|
||||||
if (is_true < 0) {
|
if (is_true < 0) {
|
||||||
|
@ -1148,7 +1148,7 @@ FutureObj_set_log_traceback(FutureObj *fut, PyObject *val)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
FutureObj_get_loop(FutureObj *fut)
|
FutureObj_get_loop(FutureObj *fut, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (!future_is_alive(fut)) {
|
if (!future_is_alive(fut)) {
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
|
@ -1158,7 +1158,7 @@ FutureObj_get_loop(FutureObj *fut)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
FutureObj_get_callbacks(FutureObj *fut)
|
FutureObj_get_callbacks(FutureObj *fut, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
Py_ssize_t i;
|
Py_ssize_t i;
|
||||||
|
|
||||||
|
@ -1210,7 +1210,7 @@ FutureObj_get_callbacks(FutureObj *fut)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
FutureObj_get_result(FutureObj *fut)
|
FutureObj_get_result(FutureObj *fut, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
ENSURE_FUTURE_ALIVE(fut)
|
ENSURE_FUTURE_ALIVE(fut)
|
||||||
if (fut->fut_result == NULL) {
|
if (fut->fut_result == NULL) {
|
||||||
|
@ -1221,7 +1221,7 @@ FutureObj_get_result(FutureObj *fut)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
FutureObj_get_exception(FutureObj *fut)
|
FutureObj_get_exception(FutureObj *fut, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
ENSURE_FUTURE_ALIVE(fut)
|
ENSURE_FUTURE_ALIVE(fut)
|
||||||
if (fut->fut_exception == NULL) {
|
if (fut->fut_exception == NULL) {
|
||||||
|
@ -1232,7 +1232,7 @@ FutureObj_get_exception(FutureObj *fut)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
FutureObj_get_source_traceback(FutureObj *fut)
|
FutureObj_get_source_traceback(FutureObj *fut, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (!future_is_alive(fut) || fut->fut_source_tb == NULL) {
|
if (!future_is_alive(fut) || fut->fut_source_tb == NULL) {
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
|
@ -1242,7 +1242,7 @@ FutureObj_get_source_traceback(FutureObj *fut)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
FutureObj_get_state(FutureObj *fut)
|
FutureObj_get_state(FutureObj *fut, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
_Py_IDENTIFIER(PENDING);
|
_Py_IDENTIFIER(PENDING);
|
||||||
_Py_IDENTIFIER(CANCELLED);
|
_Py_IDENTIFIER(CANCELLED);
|
||||||
|
@ -1723,7 +1723,7 @@ TaskStepMethWrapper_traverse(TaskStepMethWrapper *o,
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
TaskStepMethWrapper_get___self__(TaskStepMethWrapper *o)
|
TaskStepMethWrapper_get___self__(TaskStepMethWrapper *o, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (o->sw_task) {
|
if (o->sw_task) {
|
||||||
Py_INCREF(o->sw_task);
|
Py_INCREF(o->sw_task);
|
||||||
|
@ -1995,7 +1995,7 @@ TaskObj_traverse(TaskObj *task, visitproc visit, void *arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
TaskObj_get_log_destroy_pending(TaskObj *task)
|
TaskObj_get_log_destroy_pending(TaskObj *task, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (task->task_log_destroy_pending) {
|
if (task->task_log_destroy_pending) {
|
||||||
Py_RETURN_TRUE;
|
Py_RETURN_TRUE;
|
||||||
|
@ -2006,7 +2006,7 @@ TaskObj_get_log_destroy_pending(TaskObj *task)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
TaskObj_set_log_destroy_pending(TaskObj *task, PyObject *val)
|
TaskObj_set_log_destroy_pending(TaskObj *task, PyObject *val, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
int is_true = PyObject_IsTrue(val);
|
int is_true = PyObject_IsTrue(val);
|
||||||
if (is_true < 0) {
|
if (is_true < 0) {
|
||||||
|
@ -2017,7 +2017,7 @@ TaskObj_set_log_destroy_pending(TaskObj *task, PyObject *val)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
TaskObj_get_must_cancel(TaskObj *task)
|
TaskObj_get_must_cancel(TaskObj *task, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (task->task_must_cancel) {
|
if (task->task_must_cancel) {
|
||||||
Py_RETURN_TRUE;
|
Py_RETURN_TRUE;
|
||||||
|
@ -2028,7 +2028,7 @@ TaskObj_get_must_cancel(TaskObj *task)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
TaskObj_get_coro(TaskObj *task)
|
TaskObj_get_coro(TaskObj *task, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (task->task_coro) {
|
if (task->task_coro) {
|
||||||
Py_INCREF(task->task_coro);
|
Py_INCREF(task->task_coro);
|
||||||
|
@ -2039,7 +2039,7 @@ TaskObj_get_coro(TaskObj *task)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
TaskObj_get_fut_waiter(TaskObj *task)
|
TaskObj_get_fut_waiter(TaskObj *task, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (task->task_fut_waiter) {
|
if (task->task_fut_waiter) {
|
||||||
Py_INCREF(task->task_fut_waiter);
|
Py_INCREF(task->task_fut_waiter);
|
||||||
|
|
|
@ -1542,7 +1542,7 @@ deque_bool(dequeobject *deque)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
deque_get_maxlen(dequeobject *deque)
|
deque_get_maxlen(dequeobject *deque, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (deque->maxlen < 0)
|
if (deque->maxlen < 0)
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
|
|
|
@ -159,31 +159,31 @@ get_nullchar_as_None(Py_UCS4 c)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Dialect_get_lineterminator(DialectObj *self)
|
Dialect_get_lineterminator(DialectObj *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
return get_string(self->lineterminator);
|
return get_string(self->lineterminator);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Dialect_get_delimiter(DialectObj *self)
|
Dialect_get_delimiter(DialectObj *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
return get_nullchar_as_None(self->delimiter);
|
return get_nullchar_as_None(self->delimiter);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Dialect_get_escapechar(DialectObj *self)
|
Dialect_get_escapechar(DialectObj *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
return get_nullchar_as_None(self->escapechar);
|
return get_nullchar_as_None(self->escapechar);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Dialect_get_quotechar(DialectObj *self)
|
Dialect_get_quotechar(DialectObj *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
return get_nullchar_as_None(self->quotechar);
|
return get_nullchar_as_None(self->quotechar);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Dialect_get_quoting(DialectObj *self)
|
Dialect_get_quoting(DialectObj *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
return PyLong_FromLong(self->quoting);
|
return PyLong_FromLong(self->quoting);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1161,7 +1161,7 @@ PyTypeObject PyCPointerType_Type = {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
CharArray_set_raw(CDataObject *self, PyObject *value)
|
CharArray_set_raw(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
char *ptr;
|
char *ptr;
|
||||||
Py_ssize_t size;
|
Py_ssize_t size;
|
||||||
|
@ -1187,13 +1187,13 @@ CharArray_set_raw(CDataObject *self, PyObject *value)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
CharArray_get_raw(CDataObject *self)
|
CharArray_get_raw(CDataObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
return PyBytes_FromStringAndSize(self->b_ptr, self->b_size);
|
return PyBytes_FromStringAndSize(self->b_ptr, self->b_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
CharArray_get_value(CDataObject *self)
|
CharArray_get_value(CDataObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
Py_ssize_t i;
|
Py_ssize_t i;
|
||||||
char *ptr = self->b_ptr;
|
char *ptr = self->b_ptr;
|
||||||
|
@ -1204,7 +1204,7 @@ CharArray_get_value(CDataObject *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
CharArray_set_value(CDataObject *self, PyObject *value)
|
CharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
char *ptr;
|
char *ptr;
|
||||||
Py_ssize_t size;
|
Py_ssize_t size;
|
||||||
|
@ -1249,7 +1249,7 @@ static PyGetSetDef CharArray_getsets[] = {
|
||||||
|
|
||||||
#ifdef CTYPES_UNICODE
|
#ifdef CTYPES_UNICODE
|
||||||
static PyObject *
|
static PyObject *
|
||||||
WCharArray_get_value(CDataObject *self)
|
WCharArray_get_value(CDataObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
Py_ssize_t i;
|
Py_ssize_t i;
|
||||||
wchar_t *ptr = (wchar_t *)self->b_ptr;
|
wchar_t *ptr = (wchar_t *)self->b_ptr;
|
||||||
|
@ -1260,7 +1260,7 @@ WCharArray_get_value(CDataObject *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
WCharArray_set_value(CDataObject *self, PyObject *value)
|
WCharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
Py_ssize_t result = 0;
|
Py_ssize_t result = 0;
|
||||||
Py_UNICODE *wstr;
|
Py_UNICODE *wstr;
|
||||||
|
@ -3045,7 +3045,7 @@ GenericPyCData_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
PyCFuncPtr_set_errcheck(PyCFuncPtrObject *self, PyObject *ob)
|
PyCFuncPtr_set_errcheck(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (ob && !PyCallable_Check(ob)) {
|
if (ob && !PyCallable_Check(ob)) {
|
||||||
PyErr_SetString(PyExc_TypeError,
|
PyErr_SetString(PyExc_TypeError,
|
||||||
|
@ -3058,7 +3058,7 @@ PyCFuncPtr_set_errcheck(PyCFuncPtrObject *self, PyObject *ob)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
PyCFuncPtr_get_errcheck(PyCFuncPtrObject *self)
|
PyCFuncPtr_get_errcheck(PyCFuncPtrObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (self->errcheck) {
|
if (self->errcheck) {
|
||||||
Py_INCREF(self->errcheck);
|
Py_INCREF(self->errcheck);
|
||||||
|
@ -3068,7 +3068,7 @@ PyCFuncPtr_get_errcheck(PyCFuncPtrObject *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob)
|
PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (ob == NULL) {
|
if (ob == NULL) {
|
||||||
Py_CLEAR(self->restype);
|
Py_CLEAR(self->restype);
|
||||||
|
@ -3089,7 +3089,7 @@ PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
PyCFuncPtr_get_restype(PyCFuncPtrObject *self)
|
PyCFuncPtr_get_restype(PyCFuncPtrObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
StgDictObject *dict;
|
StgDictObject *dict;
|
||||||
if (self->restype) {
|
if (self->restype) {
|
||||||
|
@ -3107,7 +3107,7 @@ PyCFuncPtr_get_restype(PyCFuncPtrObject *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob)
|
PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
PyObject *converters;
|
PyObject *converters;
|
||||||
|
|
||||||
|
@ -3126,7 +3126,7 @@ PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
PyCFuncPtr_get_argtypes(PyCFuncPtrObject *self)
|
PyCFuncPtr_get_argtypes(PyCFuncPtrObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
StgDictObject *dict;
|
StgDictObject *dict;
|
||||||
if (self->argtypes) {
|
if (self->argtypes) {
|
||||||
|
@ -4670,7 +4670,7 @@ PyCArrayType_from_ctype(PyObject *itemtype, Py_ssize_t length)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Simple_set_value(CDataObject *self, PyObject *value)
|
Simple_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
PyObject *result;
|
PyObject *result;
|
||||||
StgDictObject *dict = PyObject_stgdict((PyObject *)self);
|
StgDictObject *dict = PyObject_stgdict((PyObject *)self);
|
||||||
|
@ -4697,12 +4697,12 @@ Simple_init(CDataObject *self, PyObject *args, PyObject *kw)
|
||||||
if (!PyArg_UnpackTuple(args, "__init__", 0, 1, &value))
|
if (!PyArg_UnpackTuple(args, "__init__", 0, 1, &value))
|
||||||
return -1;
|
return -1;
|
||||||
if (value)
|
if (value)
|
||||||
return Simple_set_value(self, value);
|
return Simple_set_value(self, value, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Simple_get_value(CDataObject *self)
|
Simple_get_value(CDataObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
StgDictObject *dict;
|
StgDictObject *dict;
|
||||||
dict = PyObject_stgdict((PyObject *)self);
|
dict = PyObject_stgdict((PyObject *)self);
|
||||||
|
@ -4725,7 +4725,7 @@ Simple_from_outparm(PyObject *self, PyObject *args)
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
/* call stgdict->getfunc */
|
/* call stgdict->getfunc */
|
||||||
return Simple_get_value((CDataObject *)self);
|
return Simple_get_value((CDataObject *)self, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyMethodDef Simple_methods[] = {
|
static PyMethodDef Simple_methods[] = {
|
||||||
|
@ -4762,7 +4762,7 @@ Simple_repr(CDataObject *self)
|
||||||
Py_TYPE(self)->tp_name, self);
|
Py_TYPE(self)->tp_name, self);
|
||||||
}
|
}
|
||||||
|
|
||||||
val = Simple_get_value(self);
|
val = Simple_get_value(self, NULL);
|
||||||
if (val == NULL)
|
if (val == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
@ -1960,7 +1960,7 @@ PyCursesWindow_get_encoding(PyCursesWindowObject *self, void *closure)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
PyCursesWindow_set_encoding(PyCursesWindowObject *self, PyObject *value)
|
PyCursesWindow_set_encoding(PyCursesWindowObject *self, PyObject *value, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
PyObject *ascii;
|
PyObject *ascii;
|
||||||
char *encoding;
|
char *encoding;
|
||||||
|
|
|
@ -201,7 +201,7 @@ write_bytes(bytesio *self, const char *bytes, Py_ssize_t len)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
bytesio_get_closed(bytesio *self)
|
bytesio_get_closed(bytesio *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (self->buf == NULL) {
|
if (self->buf == NULL) {
|
||||||
Py_RETURN_TRUE;
|
Py_RETURN_TRUE;
|
||||||
|
|
|
@ -4563,13 +4563,13 @@ PicklerMemoProxy_New(PicklerObject *pickler)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Pickler_get_memo(PicklerObject *self)
|
Pickler_get_memo(PicklerObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
return PicklerMemoProxy_New(self);
|
return PicklerMemoProxy_New(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Pickler_set_memo(PicklerObject *self, PyObject *obj)
|
Pickler_set_memo(PicklerObject *self, PyObject *obj, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
PyMemoTable *new_memo = NULL;
|
PyMemoTable *new_memo = NULL;
|
||||||
|
|
||||||
|
@ -4631,7 +4631,7 @@ Pickler_set_memo(PicklerObject *self, PyObject *obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Pickler_get_persid(PicklerObject *self)
|
Pickler_get_persid(PicklerObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (self->pers_func == NULL) {
|
if (self->pers_func == NULL) {
|
||||||
PyErr_SetString(PyExc_AttributeError, "persistent_id");
|
PyErr_SetString(PyExc_AttributeError, "persistent_id");
|
||||||
|
@ -4641,7 +4641,7 @@ Pickler_get_persid(PicklerObject *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Pickler_set_persid(PicklerObject *self, PyObject *value)
|
Pickler_set_persid(PicklerObject *self, PyObject *value, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (value == NULL) {
|
if (value == NULL) {
|
||||||
PyErr_SetString(PyExc_TypeError,
|
PyErr_SetString(PyExc_TypeError,
|
||||||
|
@ -6999,13 +6999,13 @@ UnpicklerMemoProxy_New(UnpicklerObject *unpickler)
|
||||||
|
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Unpickler_get_memo(UnpicklerObject *self)
|
Unpickler_get_memo(UnpicklerObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
return UnpicklerMemoProxy_New(self);
|
return UnpicklerMemoProxy_New(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Unpickler_set_memo(UnpicklerObject *self, PyObject *obj)
|
Unpickler_set_memo(UnpicklerObject *self, PyObject *obj, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
PyObject **new_memo;
|
PyObject **new_memo;
|
||||||
size_t new_memo_size = 0;
|
size_t new_memo_size = 0;
|
||||||
|
@ -7082,7 +7082,7 @@ Unpickler_set_memo(UnpicklerObject *self, PyObject *obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Unpickler_get_persload(UnpicklerObject *self)
|
Unpickler_get_persload(UnpicklerObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (self->pers_func == NULL) {
|
if (self->pers_func == NULL) {
|
||||||
PyErr_SetString(PyExc_AttributeError, "persistent_load");
|
PyErr_SetString(PyExc_AttributeError, "persistent_load");
|
||||||
|
@ -7092,7 +7092,7 @@ Unpickler_get_persload(UnpicklerObject *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Unpickler_set_persload(UnpicklerObject *self, PyObject *value)
|
Unpickler_set_persload(UnpicklerObject *self, PyObject *value, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (value == NULL) {
|
if (value == NULL) {
|
||||||
PyErr_SetString(PyExc_TypeError,
|
PyErr_SetString(PyExc_TypeError,
|
||||||
|
|
|
@ -55,7 +55,7 @@ static const char * const begin_statements[] = {
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level);
|
static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level, void *Py_UNUSED(ignored));
|
||||||
static void _pysqlite_drop_unused_cursor_references(pysqlite_Connection* self);
|
static void _pysqlite_drop_unused_cursor_references(pysqlite_Connection* self);
|
||||||
|
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject
|
||||||
Py_INCREF(isolation_level);
|
Py_INCREF(isolation_level);
|
||||||
}
|
}
|
||||||
Py_CLEAR(self->isolation_level);
|
Py_CLEAR(self->isolation_level);
|
||||||
if (pysqlite_connection_set_isolation_level(self, isolation_level) < 0) {
|
if (pysqlite_connection_set_isolation_level(self, isolation_level, NULL) < 0) {
|
||||||
Py_DECREF(isolation_level);
|
Py_DECREF(isolation_level);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -1139,7 +1139,8 @@ static PyObject* pysqlite_connection_get_in_transaction(pysqlite_Connection* sel
|
||||||
Py_RETURN_FALSE;
|
Py_RETURN_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level)
|
static int
|
||||||
|
pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (isolation_level == Py_None) {
|
if (isolation_level == Py_None) {
|
||||||
PyObject *res = pysqlite_connection_commit(self, NULL);
|
PyObject *res = pysqlite_connection_commit(self, NULL);
|
||||||
|
|
|
@ -150,7 +150,8 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_ssize_t pysqlite_row_length(pysqlite_Row* self, PyObject* args, PyObject* kwargs)
|
static Py_ssize_t
|
||||||
|
pysqlite_row_length(pysqlite_Row* self)
|
||||||
{
|
{
|
||||||
return PyTuple_GET_SIZE(self->data);
|
return PyTuple_GET_SIZE(self->data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1312,7 +1312,7 @@ PyDoc_STRVAR(pattern_doc, "Compiled regular expression object.");
|
||||||
|
|
||||||
/* PatternObject's 'groupindex' method. */
|
/* PatternObject's 'groupindex' method. */
|
||||||
static PyObject *
|
static PyObject *
|
||||||
pattern_groupindex(PatternObject *self)
|
pattern_groupindex(PatternObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (self->groupindex == NULL)
|
if (self->groupindex == NULL)
|
||||||
return PyDict_New();
|
return PyDict_New();
|
||||||
|
@ -2279,7 +2279,7 @@ PyDoc_STRVAR(match_group_doc,
|
||||||
For 0 returns the entire match.");
|
For 0 returns the entire match.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
match_lastindex_get(MatchObject *self)
|
match_lastindex_get(MatchObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (self->lastindex >= 0)
|
if (self->lastindex >= 0)
|
||||||
return PyLong_FromSsize_t(self->lastindex);
|
return PyLong_FromSsize_t(self->lastindex);
|
||||||
|
@ -2287,7 +2287,7 @@ match_lastindex_get(MatchObject *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
match_lastgroup_get(MatchObject *self)
|
match_lastgroup_get(MatchObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (self->pattern->indexgroup &&
|
if (self->pattern->indexgroup &&
|
||||||
self->lastindex >= 0 &&
|
self->lastindex >= 0 &&
|
||||||
|
@ -2302,7 +2302,7 @@ match_lastgroup_get(MatchObject *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
match_regs_get(MatchObject *self)
|
match_regs_get(MatchObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (self->regs) {
|
if (self->regs) {
|
||||||
Py_INCREF(self->regs);
|
Py_INCREF(self->regs);
|
||||||
|
|
|
@ -1531,7 +1531,7 @@ ndarray_getbuf(NDArrayObject *self, Py_buffer *view, int flags)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static void
|
||||||
ndarray_releasebuf(NDArrayObject *self, Py_buffer *view)
|
ndarray_releasebuf(NDArrayObject *self, Py_buffer *view)
|
||||||
{
|
{
|
||||||
if (!ND_IS_CONSUMER(self)) {
|
if (!ND_IS_CONSUMER(self)) {
|
||||||
|
@ -1539,8 +1539,6 @@ ndarray_releasebuf(NDArrayObject *self, Py_buffer *view)
|
||||||
if (--ndbuf->exports == 0 && ndbuf != self->head)
|
if (--ndbuf->exports == 0 && ndbuf != self->head)
|
||||||
ndbuf_delete(self, ndbuf);
|
ndbuf_delete(self, ndbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyBufferProcs ndarray_as_buffer = {
|
static PyBufferProcs ndarray_as_buffer = {
|
||||||
|
|
|
@ -842,7 +842,7 @@ PyTclObject_string(PyTclObject *self, void *ignored)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
PyTclObject_str(PyTclObject *self, void *ignored)
|
PyTclObject_str(PyTclObject *self)
|
||||||
{
|
{
|
||||||
if (self->string) {
|
if (self->string) {
|
||||||
Py_INCREF(self->string);
|
Py_INCREF(self->string);
|
||||||
|
@ -855,7 +855,7 @@ PyTclObject_str(PyTclObject *self, void *ignored)
|
||||||
static PyObject *
|
static PyObject *
|
||||||
PyTclObject_repr(PyTclObject *self)
|
PyTclObject_repr(PyTclObject *self)
|
||||||
{
|
{
|
||||||
PyObject *repr, *str = PyTclObject_str(self, NULL);
|
PyObject *repr, *str = PyTclObject_str(self);
|
||||||
if (str == NULL)
|
if (str == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
repr = PyUnicode_FromFormat("<%s object: %R>",
|
repr = PyUnicode_FromFormat("<%s object: %R>",
|
||||||
|
|
|
@ -108,7 +108,7 @@ call_error_callback(PyObject *errors, PyObject *exc)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
codecctx_errors_get(MultibyteStatefulCodecContext *self)
|
codecctx_errors_get(MultibyteStatefulCodecContext *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
const char *errors;
|
const char *errors;
|
||||||
|
|
||||||
|
|
|
@ -653,7 +653,7 @@ mmap_move_method(mmap_object *self, PyObject *args)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
mmap_closed_get(mmap_object *self)
|
mmap_closed_get(mmap_object *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
#ifdef MS_WINDOWS
|
#ifdef MS_WINDOWS
|
||||||
return PyBool_FromLong(self->map_handle == NULL ? 1 : 0);
|
return PyBool_FromLong(self->map_handle == NULL ? 1 : 0);
|
||||||
|
|
|
@ -1023,7 +1023,7 @@ Close the devpoll file descriptor. Further operations on the devpoll\n\
|
||||||
object will raise an exception.");
|
object will raise an exception.");
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
devpoll_get_closed(devpollObject *self)
|
devpoll_get_closed(devpollObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (self->fd_devpoll < 0)
|
if (self->fd_devpoll < 0)
|
||||||
Py_RETURN_TRUE;
|
Py_RETURN_TRUE;
|
||||||
|
@ -1346,7 +1346,7 @@ Close the epoll control file descriptor. Further operations on the epoll\n\
|
||||||
object will raise an exception.");
|
object will raise an exception.");
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
pyepoll_get_closed(pyEpoll_Object *self)
|
pyepoll_get_closed(pyEpoll_Object *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (self->epfd < 0)
|
if (self->epfd < 0)
|
||||||
Py_RETURN_TRUE;
|
Py_RETURN_TRUE;
|
||||||
|
@ -2072,7 +2072,7 @@ Close the kqueue control file descriptor. Further operations on the kqueue\n\
|
||||||
object will raise an exception.");
|
object will raise an exception.");
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
kqueue_queue_get_closed(kqueue_queue_Object *self)
|
kqueue_queue_get_closed(kqueue_queue_Object *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (self->kqfd < 0)
|
if (self->kqfd < 0)
|
||||||
Py_RETURN_TRUE;
|
Py_RETURN_TRUE;
|
||||||
|
|
|
@ -89,7 +89,7 @@ spamlist_init(spamlistobject *self, PyObject *args, PyObject *kwds)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
spamlist_state_get(spamlistobject *self)
|
spamlist_state_get(spamlistobject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
return PyLong_FromLong(self->state);
|
return PyLong_FromLong(self->state);
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,7 @@ cell_get_contents(PyCellObject *op, void *closure)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cell_set_contents(PyCellObject *op, PyObject *obj)
|
cell_set_contents(PyCellObject *op, PyObject *obj, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
Py_XINCREF(obj);
|
Py_XINCREF(obj);
|
||||||
Py_XSETREF(op->ob_ref, obj);
|
Py_XSETREF(op->ob_ref, obj);
|
||||||
|
|
|
@ -439,7 +439,7 @@ calculate_qualname(PyDescrObject *descr)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
descr_get_qualname(PyDescrObject *descr)
|
descr_get_qualname(PyDescrObject *descr, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (descr->d_qualname == NULL)
|
if (descr->d_qualname == NULL)
|
||||||
descr->d_qualname = calculate_qualname(descr);
|
descr->d_qualname = calculate_qualname(descr);
|
||||||
|
@ -1108,7 +1108,7 @@ static PyMemberDef wrapper_members[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
wrapper_objclass(wrapperobject *wp)
|
wrapper_objclass(wrapperobject *wp, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
PyObject *c = (PyObject *)PyDescr_TYPE(wp->descr);
|
PyObject *c = (PyObject *)PyDescr_TYPE(wp->descr);
|
||||||
|
|
||||||
|
@ -1117,7 +1117,7 @@ wrapper_objclass(wrapperobject *wp)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
wrapper_name(wrapperobject *wp)
|
wrapper_name(wrapperobject *wp, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
const char *s = wp->descr->d_base->name;
|
const char *s = wp->descr->d_base->name;
|
||||||
|
|
||||||
|
@ -1125,21 +1125,21 @@ wrapper_name(wrapperobject *wp)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
wrapper_doc(wrapperobject *wp, void *closure)
|
wrapper_doc(wrapperobject *wp, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
return _PyType_GetDocFromInternalDoc(wp->descr->d_base->name, wp->descr->d_base->doc);
|
return _PyType_GetDocFromInternalDoc(wp->descr->d_base->name, wp->descr->d_base->doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
wrapper_text_signature(wrapperobject *wp, void *closure)
|
wrapper_text_signature(wrapperobject *wp, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
return _PyType_GetTextSignatureFromInternalDoc(wp->descr->d_base->name, wp->descr->d_base->doc);
|
return _PyType_GetTextSignatureFromInternalDoc(wp->descr->d_base->name, wp->descr->d_base->doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
wrapper_qualname(wrapperobject *wp)
|
wrapper_qualname(wrapperobject *wp, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
return descr_get_qualname((PyDescrObject *)wp->descr);
|
return descr_get_qualname((PyDescrObject *)wp->descr, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyGetSetDef wrapper_getsets[] = {
|
static PyGetSetDef wrapper_getsets[] = {
|
||||||
|
|
|
@ -181,7 +181,7 @@ static PyMethodDef BaseException_methods[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
BaseException_get_args(PyBaseExceptionObject *self)
|
BaseException_get_args(PyBaseExceptionObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (self->args == NULL) {
|
if (self->args == NULL) {
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
|
@ -191,7 +191,7 @@ BaseException_get_args(PyBaseExceptionObject *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
BaseException_set_args(PyBaseExceptionObject *self, PyObject *val)
|
BaseException_set_args(PyBaseExceptionObject *self, PyObject *val, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
PyObject *seq;
|
PyObject *seq;
|
||||||
if (val == NULL) {
|
if (val == NULL) {
|
||||||
|
@ -206,7 +206,7 @@ BaseException_set_args(PyBaseExceptionObject *self, PyObject *val)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
BaseException_get_tb(PyBaseExceptionObject *self)
|
BaseException_get_tb(PyBaseExceptionObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (self->traceback == NULL) {
|
if (self->traceback == NULL) {
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
|
@ -216,7 +216,7 @@ BaseException_get_tb(PyBaseExceptionObject *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
BaseException_set_tb(PyBaseExceptionObject *self, PyObject *tb)
|
BaseException_set_tb(PyBaseExceptionObject *self, PyObject *tb, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (tb == NULL) {
|
if (tb == NULL) {
|
||||||
PyErr_SetString(PyExc_TypeError, "__traceback__ may not be deleted");
|
PyErr_SetString(PyExc_TypeError, "__traceback__ may not be deleted");
|
||||||
|
@ -234,7 +234,8 @@ BaseException_set_tb(PyBaseExceptionObject *self, PyObject *tb)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
BaseException_get_context(PyObject *self) {
|
BaseException_get_context(PyObject *self, void *Py_UNUSED(ignored))
|
||||||
|
{
|
||||||
PyObject *res = PyException_GetContext(self);
|
PyObject *res = PyException_GetContext(self);
|
||||||
if (res)
|
if (res)
|
||||||
return res; /* new reference already returned above */
|
return res; /* new reference already returned above */
|
||||||
|
@ -242,7 +243,8 @@ BaseException_get_context(PyObject *self) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
BaseException_set_context(PyObject *self, PyObject *arg) {
|
BaseException_set_context(PyObject *self, PyObject *arg, void *Py_UNUSED(ignored))
|
||||||
|
{
|
||||||
if (arg == NULL) {
|
if (arg == NULL) {
|
||||||
PyErr_SetString(PyExc_TypeError, "__context__ may not be deleted");
|
PyErr_SetString(PyExc_TypeError, "__context__ may not be deleted");
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -261,7 +263,8 @@ BaseException_set_context(PyObject *self, PyObject *arg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
BaseException_get_cause(PyObject *self) {
|
BaseException_get_cause(PyObject *self, void *Py_UNUSED(ignored))
|
||||||
|
{
|
||||||
PyObject *res = PyException_GetCause(self);
|
PyObject *res = PyException_GetCause(self);
|
||||||
if (res)
|
if (res)
|
||||||
return res; /* new reference already returned above */
|
return res; /* new reference already returned above */
|
||||||
|
@ -269,7 +272,8 @@ BaseException_get_cause(PyObject *self) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
BaseException_set_cause(PyObject *self, PyObject *arg) {
|
BaseException_set_cause(PyObject *self, PyObject *arg, void *Py_UNUSED(ignored))
|
||||||
|
{
|
||||||
if (arg == NULL) {
|
if (arg == NULL) {
|
||||||
PyErr_SetString(PyExc_TypeError, "__cause__ may not be deleted");
|
PyErr_SetString(PyExc_TypeError, "__cause__ may not be deleted");
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -292,10 +296,10 @@ static PyGetSetDef BaseException_getset[] = {
|
||||||
{"__dict__", PyObject_GenericGetDict, PyObject_GenericSetDict},
|
{"__dict__", PyObject_GenericGetDict, PyObject_GenericSetDict},
|
||||||
{"args", (getter)BaseException_get_args, (setter)BaseException_set_args},
|
{"args", (getter)BaseException_get_args, (setter)BaseException_set_args},
|
||||||
{"__traceback__", (getter)BaseException_get_tb, (setter)BaseException_set_tb},
|
{"__traceback__", (getter)BaseException_get_tb, (setter)BaseException_set_tb},
|
||||||
{"__context__", (getter)BaseException_get_context,
|
{"__context__", BaseException_get_context,
|
||||||
(setter)BaseException_set_context, PyDoc_STR("exception context")},
|
BaseException_set_context, PyDoc_STR("exception context")},
|
||||||
{"__cause__", (getter)BaseException_get_cause,
|
{"__cause__", BaseException_get_cause,
|
||||||
(setter)BaseException_set_cause, PyDoc_STR("exception cause")},
|
BaseException_set_cause, PyDoc_STR("exception cause")},
|
||||||
{NULL},
|
{NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -310,7 +314,7 @@ PyException_GetTraceback(PyObject *self) {
|
||||||
|
|
||||||
int
|
int
|
||||||
PyException_SetTraceback(PyObject *self, PyObject *tb) {
|
PyException_SetTraceback(PyObject *self, PyObject *tb) {
|
||||||
return BaseException_set_tb((PyBaseExceptionObject *)self, tb);
|
return BaseException_set_tb((PyBaseExceptionObject *)self, tb, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject *
|
PyObject *
|
||||||
|
|
|
@ -64,7 +64,7 @@ frame_getlineno(PyFrameObject *f, void *closure)
|
||||||
* that time.
|
* that time.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno)
|
frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
int new_lineno = 0; /* The new value of f_lineno */
|
int new_lineno = 0; /* The new value of f_lineno */
|
||||||
long l_new_lineno;
|
long l_new_lineno;
|
||||||
|
@ -519,7 +519,7 @@ frame_traverse(PyFrameObject *f, visitproc visit, void *arg)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
frame_tp_clear(PyFrameObject *f)
|
frame_tp_clear(PyFrameObject *f)
|
||||||
{
|
{
|
||||||
PyObject **fastlocals, **p, **oldtop;
|
PyObject **fastlocals, **p, **oldtop;
|
||||||
|
@ -547,6 +547,7 @@ frame_tp_clear(PyFrameObject *f)
|
||||||
for (p = f->f_valuestack; p < oldtop; p++)
|
for (p = f->f_valuestack; p < oldtop; p++)
|
||||||
Py_CLEAR(*p);
|
Py_CLEAR(*p);
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
|
@ -561,7 +562,7 @@ frame_clear(PyFrameObject *f)
|
||||||
_PyGen_Finalize(f->f_gen);
|
_PyGen_Finalize(f->f_gen);
|
||||||
assert(f->f_gen == NULL);
|
assert(f->f_gen == NULL);
|
||||||
}
|
}
|
||||||
frame_tp_clear(f);
|
(void)frame_tp_clear(f);
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -242,14 +242,14 @@ static PyMemberDef func_memberlist[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
func_get_code(PyFunctionObject *op)
|
func_get_code(PyFunctionObject *op, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
Py_INCREF(op->func_code);
|
Py_INCREF(op->func_code);
|
||||||
return op->func_code;
|
return op->func_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
func_set_code(PyFunctionObject *op, PyObject *value)
|
func_set_code(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
Py_ssize_t nfree, nclosure;
|
Py_ssize_t nfree, nclosure;
|
||||||
|
|
||||||
|
@ -277,14 +277,14 @@ func_set_code(PyFunctionObject *op, PyObject *value)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
func_get_name(PyFunctionObject *op)
|
func_get_name(PyFunctionObject *op, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
Py_INCREF(op->func_name);
|
Py_INCREF(op->func_name);
|
||||||
return op->func_name;
|
return op->func_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
func_set_name(PyFunctionObject *op, PyObject *value)
|
func_set_name(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
/* Not legal to del f.func_name or to set it to anything
|
/* Not legal to del f.func_name or to set it to anything
|
||||||
* other than a string object. */
|
* other than a string object. */
|
||||||
|
@ -299,14 +299,14 @@ func_set_name(PyFunctionObject *op, PyObject *value)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
func_get_qualname(PyFunctionObject *op)
|
func_get_qualname(PyFunctionObject *op, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
Py_INCREF(op->func_qualname);
|
Py_INCREF(op->func_qualname);
|
||||||
return op->func_qualname;
|
return op->func_qualname;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
func_set_qualname(PyFunctionObject *op, PyObject *value)
|
func_set_qualname(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
/* Not legal to del f.__qualname__ or to set it to anything
|
/* Not legal to del f.__qualname__ or to set it to anything
|
||||||
* other than a string object. */
|
* other than a string object. */
|
||||||
|
@ -321,7 +321,7 @@ func_set_qualname(PyFunctionObject *op, PyObject *value)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
func_get_defaults(PyFunctionObject *op)
|
func_get_defaults(PyFunctionObject *op, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (op->func_defaults == NULL) {
|
if (op->func_defaults == NULL) {
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
|
@ -331,7 +331,7 @@ func_get_defaults(PyFunctionObject *op)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
func_set_defaults(PyFunctionObject *op, PyObject *value)
|
func_set_defaults(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
/* Legal to del f.func_defaults.
|
/* Legal to del f.func_defaults.
|
||||||
* Can only set func_defaults to NULL or a tuple. */
|
* Can only set func_defaults to NULL or a tuple. */
|
||||||
|
@ -348,7 +348,7 @@ func_set_defaults(PyFunctionObject *op, PyObject *value)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
func_get_kwdefaults(PyFunctionObject *op)
|
func_get_kwdefaults(PyFunctionObject *op, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (op->func_kwdefaults == NULL) {
|
if (op->func_kwdefaults == NULL) {
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
|
@ -358,7 +358,7 @@ func_get_kwdefaults(PyFunctionObject *op)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
func_set_kwdefaults(PyFunctionObject *op, PyObject *value)
|
func_set_kwdefaults(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (value == Py_None)
|
if (value == Py_None)
|
||||||
value = NULL;
|
value = NULL;
|
||||||
|
@ -375,7 +375,7 @@ func_set_kwdefaults(PyFunctionObject *op, PyObject *value)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
func_get_annotations(PyFunctionObject *op)
|
func_get_annotations(PyFunctionObject *op, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (op->func_annotations == NULL) {
|
if (op->func_annotations == NULL) {
|
||||||
op->func_annotations = PyDict_New();
|
op->func_annotations = PyDict_New();
|
||||||
|
@ -387,7 +387,7 @@ func_get_annotations(PyFunctionObject *op)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
func_set_annotations(PyFunctionObject *op, PyObject *value)
|
func_set_annotations(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (value == Py_None)
|
if (value == Py_None)
|
||||||
value = NULL;
|
value = NULL;
|
||||||
|
|
|
@ -644,14 +644,14 @@ gen_repr(PyGenObject *gen)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
gen_get_name(PyGenObject *op)
|
gen_get_name(PyGenObject *op, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
Py_INCREF(op->gi_name);
|
Py_INCREF(op->gi_name);
|
||||||
return op->gi_name;
|
return op->gi_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
gen_set_name(PyGenObject *op, PyObject *value)
|
gen_set_name(PyGenObject *op, PyObject *value, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
/* Not legal to del gen.gi_name or to set it to anything
|
/* Not legal to del gen.gi_name or to set it to anything
|
||||||
* other than a string object. */
|
* other than a string object. */
|
||||||
|
@ -666,14 +666,14 @@ gen_set_name(PyGenObject *op, PyObject *value)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
gen_get_qualname(PyGenObject *op)
|
gen_get_qualname(PyGenObject *op, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
Py_INCREF(op->gi_qualname);
|
Py_INCREF(op->gi_qualname);
|
||||||
return op->gi_qualname;
|
return op->gi_qualname;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
gen_set_qualname(PyGenObject *op, PyObject *value)
|
gen_set_qualname(PyGenObject *op, PyObject *value, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
/* Not legal to del gen.__qualname__ or to set it to anything
|
/* Not legal to del gen.__qualname__ or to set it to anything
|
||||||
* other than a string object. */
|
* other than a string object. */
|
||||||
|
@ -688,7 +688,7 @@ gen_set_qualname(PyGenObject *op, PyObject *value)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
gen_getyieldfrom(PyGenObject *gen)
|
gen_getyieldfrom(PyGenObject *gen, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
PyObject *yf = _PyGen_yf(gen);
|
PyObject *yf = _PyGen_yf(gen);
|
||||||
if (yf == NULL)
|
if (yf == NULL)
|
||||||
|
@ -927,7 +927,7 @@ coro_await(PyCoroObject *coro)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
coro_get_cr_await(PyCoroObject *coro)
|
coro_get_cr_await(PyCoroObject *coro, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
PyObject *yf = _PyGen_yf((PyGenObject *) coro);
|
PyObject *yf = _PyGen_yf((PyGenObject *) coro);
|
||||||
if (yf == NULL)
|
if (yf == NULL)
|
||||||
|
|
|
@ -2905,7 +2905,7 @@ _IntTupleFromSsizet(int len, Py_ssize_t *vals)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
memory_obj_get(PyMemoryViewObject *self)
|
memory_obj_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
Py_buffer *view = &self->view;
|
Py_buffer *view = &self->view;
|
||||||
|
|
||||||
|
@ -2918,56 +2918,56 @@ memory_obj_get(PyMemoryViewObject *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
memory_nbytes_get(PyMemoryViewObject *self)
|
memory_nbytes_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
CHECK_RELEASED(self);
|
CHECK_RELEASED(self);
|
||||||
return PyLong_FromSsize_t(self->view.len);
|
return PyLong_FromSsize_t(self->view.len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
memory_format_get(PyMemoryViewObject *self)
|
memory_format_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
CHECK_RELEASED(self);
|
CHECK_RELEASED(self);
|
||||||
return PyUnicode_FromString(self->view.format);
|
return PyUnicode_FromString(self->view.format);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
memory_itemsize_get(PyMemoryViewObject *self)
|
memory_itemsize_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
CHECK_RELEASED(self);
|
CHECK_RELEASED(self);
|
||||||
return PyLong_FromSsize_t(self->view.itemsize);
|
return PyLong_FromSsize_t(self->view.itemsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
memory_shape_get(PyMemoryViewObject *self)
|
memory_shape_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
CHECK_RELEASED(self);
|
CHECK_RELEASED(self);
|
||||||
return _IntTupleFromSsizet(self->view.ndim, self->view.shape);
|
return _IntTupleFromSsizet(self->view.ndim, self->view.shape);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
memory_strides_get(PyMemoryViewObject *self)
|
memory_strides_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
CHECK_RELEASED(self);
|
CHECK_RELEASED(self);
|
||||||
return _IntTupleFromSsizet(self->view.ndim, self->view.strides);
|
return _IntTupleFromSsizet(self->view.ndim, self->view.strides);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
memory_suboffsets_get(PyMemoryViewObject *self)
|
memory_suboffsets_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
CHECK_RELEASED(self);
|
CHECK_RELEASED(self);
|
||||||
return _IntTupleFromSsizet(self->view.ndim, self->view.suboffsets);
|
return _IntTupleFromSsizet(self->view.ndim, self->view.suboffsets);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
memory_readonly_get(PyMemoryViewObject *self)
|
memory_readonly_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
CHECK_RELEASED(self);
|
CHECK_RELEASED(self);
|
||||||
return PyBool_FromLong(self->view.readonly);
|
return PyBool_FromLong(self->view.readonly);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
memory_ndim_get(PyMemoryViewObject *self)
|
memory_ndim_get(PyMemoryViewObject *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
CHECK_RELEASED(self);
|
CHECK_RELEASED(self);
|
||||||
return PyLong_FromLong(self->view.ndim);
|
return PyLong_FromLong(self->view.ndim);
|
||||||
|
|
|
@ -1105,14 +1105,14 @@ error:
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
token_get_var(PyContextToken *self)
|
token_get_var(PyContextToken *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
Py_INCREF(self->tok_var);
|
Py_INCREF(self->tok_var);
|
||||||
return (PyObject *)self->tok_var;
|
return (PyObject *)self->tok_var;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
token_get_old_value(PyContextToken *self)
|
token_get_old_value(PyContextToken *self, void *Py_UNUSED(ignored))
|
||||||
{
|
{
|
||||||
if (self->tok_oldval == NULL) {
|
if (self->tok_oldval == NULL) {
|
||||||
return get_token_missing();
|
return get_token_missing();
|
||||||
|
|
|
@ -178,11 +178,12 @@ tb_traverse(PyTracebackObject *tb, visitproc visit, void *arg)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
tb_clear(PyTracebackObject *tb)
|
tb_clear(PyTracebackObject *tb)
|
||||||
{
|
{
|
||||||
Py_CLEAR(tb->tb_next);
|
Py_CLEAR(tb->tb_next);
|
||||||
Py_CLEAR(tb->tb_frame);
|
Py_CLEAR(tb->tb_frame);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
PyTypeObject PyTraceBack_Type = {
|
PyTypeObject PyTraceBack_Type = {
|
||||||
|
|
Loading…
Reference in New Issue