Skip to content

Commit c96da83

Browse files
Fix the closure argument to PyEval_EvalCodeEx. (GH-92175)
1 parent dd57fe1 commit c96da83

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix the ``closure`` argument to :c:func:`PyEval_EvalCodeEx`.

Objects/funcobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ _PyFunction_FromConstructor(PyFrameConstructor *constr)
2929
op->func_code = constr->fc_code;
3030
op->func_defaults = NULL;
3131
op->func_kwdefaults = NULL;
32-
op->func_closure = NULL;
32+
Py_XINCREF(constr->fc_closure);
33+
op->func_closure = constr->fc_closure;
3334
Py_INCREF(Py_None);
3435
op->func_doc = Py_None;
3536
op->func_dict = NULL;

0 commit comments

Comments
 (0)