mirror of
https://github.com/python/cpython.git
synced 2025-08-27 20:25:18 +00:00
[3.12] GH-106895: Raise a ValueError
when attempting to disable events that cannot be disabled. (GH-107337) (GH-107351)
This commit is contained in:
parent
3b1a4c1842
commit
0902afbae2
8 changed files with 207 additions and 144 deletions
|
@ -48,6 +48,7 @@ method_vectorcall(PyObject *method, PyObject *const *args,
|
|||
PyObject *self = PyMethod_GET_SELF(method);
|
||||
PyObject *func = PyMethod_GET_FUNCTION(method);
|
||||
Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
|
||||
assert(nargs == 0 || args[nargs-1]);
|
||||
|
||||
PyObject *result;
|
||||
if (nargsf & PY_VECTORCALL_ARGUMENTS_OFFSET) {
|
||||
|
@ -56,6 +57,7 @@ method_vectorcall(PyObject *method, PyObject *const *args,
|
|||
nargs += 1;
|
||||
PyObject *tmp = newargs[0];
|
||||
newargs[0] = self;
|
||||
assert(newargs[nargs-1]);
|
||||
result = _PyObject_VectorcallTstate(tstate, func, newargs,
|
||||
nargs, kwnames);
|
||||
newargs[0] = tmp;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue