* ``PyThreadState_DeleteCurrent()`` has been removed. It was not documented.
(Contributed by Joannah Nanjekye in :issue:`37878`.)
+* The C function ``PyGen_NeedsFinalizing`` has been removed. It was not
+ documented, tested or used anywhere within CPython after the implementation
+ of :pep:`442`. Patch by Joannah Nanjekye.
+ (Contributed by Joannah Nanjekye in :issue:`15088`)
+
Porting to Python 3.9
=====================
PyAPI_FUNC(PyObject *) PyGen_New(struct _frame *);
PyAPI_FUNC(PyObject *) PyGen_NewWithQualName(struct _frame *,
PyObject *name, PyObject *qualname);
-PyAPI_FUNC(int) PyGen_NeedsFinalizing(PyGenObject *);
PyAPI_FUNC(int) _PyGen_SetStopIterationValue(PyObject *);
PyAPI_FUNC(int) _PyGen_FetchStopIterationValue(PyObject **);
PyAPI_FUNC(PyObject *) _PyGen_Send(PyGenObject *, PyObject *);
--- /dev/null
+The C function ``PyGen_NeedsFinalizing`` has been removed. It was not
+documented, tested or used anywhere within CPython after the implementation
+of :pep:`442`. Patch by Joannah Nanjekye.
+(Patch by Joannah Nanjekye)
\ No newline at end of file
return gen_new_with_qualname(&PyGen_Type, f, NULL, NULL);
}
-int
-PyGen_NeedsFinalizing(PyGenObject *gen)
-{
- PyFrameObject *f = gen->gi_frame;
-
- if (f == NULL || f->f_stacktop == NULL)
- return 0; /* no frame or empty blockstack == no finalization */
-
- /* Any (exception-handling) block type requires cleanup. */
- if (f->f_iblock > 0)
- return 1;
-
- /* No blocks, it's safe to skip finalization. */
- return 0;
-}
-
/* Coroutine Object */
typedef struct {
}
case TARGET(SETUP_FINALLY): {
- /* NOTE: If you add any new block-setup opcodes that
- are not try/except/finally handlers, you may need
- to update the PyGen_NeedsFinalizing() function.
- */
-
PyFrame_BlockSetup(f, SETUP_FINALLY, INSTR_OFFSET() + oparg,
STACK_LEVEL());
DISPATCH();