Fix the closure argument to PyEval_EvalCodeEx. (GH-92175)

This commit is contained in:
larryhastings 2022-05-02 13:08:22 -07:00 committed by GitHub
parent dd57fe1dd7
commit c96da83a8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1 @@
Fix the ``closure`` argument to :c:func:`PyEval_EvalCodeEx`.

View file

@ -29,7 +29,8 @@ _PyFunction_FromConstructor(PyFrameConstructor *constr)
op->func_code = constr->fc_code; op->func_code = constr->fc_code;
op->func_defaults = NULL; op->func_defaults = NULL;
op->func_kwdefaults = NULL; op->func_kwdefaults = NULL;
op->func_closure = NULL; Py_XINCREF(constr->fc_closure);
op->func_closure = constr->fc_closure;
Py_INCREF(Py_None); Py_INCREF(Py_None);
op->func_doc = Py_None; op->func_doc = Py_None;
op->func_dict = NULL; op->func_dict = NULL;