summaryrefslogtreecommitdiffstats
path: root/Modules/clinic/_opcode.c.h
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/clinic/_opcode.c.h')
-rw-r--r--Modules/clinic/_opcode.c.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/Modules/clinic/_opcode.c.h b/Modules/clinic/_opcode.c.h
index 2104a52..777701f 100644
--- a/Modules/clinic/_opcode.c.h
+++ b/Modules/clinic/_opcode.c.h
@@ -20,16 +20,38 @@ _opcode_stack_effect(PyObject *module, PyObject *const *args, Py_ssize_t nargs,
{
PyObject *return_value = NULL;
static const char * const _keywords[] = {"", "", "jump", NULL};
- static _PyArg_Parser _parser = {"i|O$O:stack_effect", _keywords, 0};
+ static _PyArg_Parser _parser = {NULL, _keywords, "stack_effect", 0};
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
int opcode;
PyObject *oparg = Py_None;
PyObject *jump = Py_None;
int _return_value;
- if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
- &opcode, &oparg, &jump)) {
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
goto exit;
}
+ if (PyFloat_Check(args[0])) {
+ PyErr_SetString(PyExc_TypeError,
+ "integer argument expected, got float" );
+ goto exit;
+ }
+ opcode = _PyLong_AsInt(args[0]);
+ if (opcode == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional_posonly;
+ }
+ noptargs--;
+ oparg = args[1];
+skip_optional_posonly:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ jump = args[2];
+skip_optional_kwonly:
_return_value = _opcode_stack_effect_impl(module, opcode, oparg, jump);
if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
@@ -39,4 +61,4 @@ _opcode_stack_effect(PyObject *module, PyObject *const *args, Py_ssize_t nargs,
exit:
return return_value;
}
-/*[clinic end generated code: output=871941eea3d855c6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7bc08f2835b2cf89 input=a9049054013a1b77]*/