[3.11] gh-101072: support default and kw default in PyEval_EvalCodeEx for 3.11+ (GH-101127) (#101636)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Matthieu Dartiailh <m.dartiailh@gmail.com>
This commit is contained in:
Łukasz Langa 2023-02-07 14:36:35 +01:00 committed by GitHub
parent 358b02dac4
commit 955ba2839b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 201 additions and 6 deletions

View file

@ -27,8 +27,10 @@ _PyFunction_FromConstructor(PyFrameConstructor *constr)
op->func_qualname = constr->fc_qualname;
Py_INCREF(constr->fc_code);
op->func_code = constr->fc_code;
op->func_defaults = NULL;
op->func_kwdefaults = NULL;
Py_XINCREF(constr->fc_defaults);
op->func_defaults = constr->fc_defaults;
Py_XINCREF(constr->fc_kwdefaults);
op->func_kwdefaults = constr->fc_kwdefaults;
Py_XINCREF(constr->fc_closure);
op->func_closure = constr->fc_closure;
Py_INCREF(Py_None);