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

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
Matthieu Dartiailh 2023-02-07 10:34:21 +01:00 committed by GitHub
parent c4de6b1d52
commit ae62bddaf8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 206 additions and 6 deletions

View file

@ -87,8 +87,8 @@ _PyFunction_FromConstructor(PyFrameConstructor *constr)
op->func_name = Py_NewRef(constr->fc_name);
op->func_qualname = Py_NewRef(constr->fc_qualname);
op->func_code = Py_NewRef(constr->fc_code);
op->func_defaults = NULL;
op->func_kwdefaults = NULL;
op->func_defaults = Py_XNewRef(constr->fc_defaults);
op->func_kwdefaults = Py_XNewRef(constr->fc_kwdefaults);
op->func_closure = Py_XNewRef(constr->fc_closure);
op->func_doc = Py_NewRef(Py_None);
op->func_dict = NULL;