summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-05-08 18:12:35 +0200
committerAntoine Pitrou <solipsis@pitrou.net>2013-05-08 18:12:35 +0200
commit04e70d19e7a5ab0cea7d3d231606180226e16f06 (patch)
treea1956f14fe0e89e656fd2161178dad0e25ff4b14 /Include/frameobject.h
parentIssue #1545463: At shutdown, defer finalization of codec modules so that stde... (diff)
downloadcpython-04e70d19e7a5ab0cea7d3d231606180226e16f06.tar.gz
cpython-04e70d19e7a5ab0cea7d3d231606180226e16f06.tar.bz2
cpython-04e70d19e7a5ab0cea7d3d231606180226e16f06.zip
Issue #17807: Generators can now be finalized even when they are part of a reference cycle.
Diffstat (limited to 'Include/frameobject.h')
-rw-r--r--Include/frameobject.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Include/frameobject.h b/Include/frameobject.h
index 33f73af52a3..0e7f32b42ae 100644
--- a/Include/frameobject.h
+++ b/Include/frameobject.h
@@ -36,6 +36,8 @@ typedef struct _frame {
non-generator frames. See the save_exc_state and swap_exc_state
functions in ceval.c for details of their use. */
PyObject *f_exc_type, *f_exc_value, *f_exc_traceback;
+ /* Borrowed referenced to a generator, or NULL */
+ PyObject *f_gen;
PyThreadState *f_tstate;
int f_lasti; /* Last instruction if called */
@@ -84,6 +86,13 @@ PyAPI_FUNC(void) _PyFrame_DebugMallocStats(FILE *out);
/* Return the line of code the frame is currently executing. */
PyAPI_FUNC(int) PyFrame_GetLineNumber(PyFrameObject *);
+/* Generator support */
+PyAPI_FUNC(PyObject *) _PyFrame_YieldingFrom(PyFrameObject *);
+PyAPI_FUNC(PyObject *) _PyFrame_GeneratorSend(PyFrameObject *, PyObject *, int exc);
+PyAPI_FUNC(PyObject *) _PyFrame_Finalize(PyFrameObject *);
+PyAPI_FUNC(int) _PyFrame_CloseIterator(PyObject *);
+
+
#ifdef __cplusplus
}
#endif