Skip to content

Commit 8d5e2aa

Browse files
committed
improve formatting/fix lint errors
1 parent 8170840 commit 8d5e2aa

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

Include/cpython/funcobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ typedef struct {
4343
PyObject *func_annotations; /* Annotations, a dict or NULL */
4444
PyObject *func_annotate; /* Callable to fill the annotations dictionary */
4545
PyObject *func_typeparams; /* Tuple of active type variables or NULL */
46-
PyObject *func_old_codes; /* NULL or list of past code objects */
46+
PyObject *func_old_codes; /* List of past code objects or NULL */
4747
vectorcallfunc vectorcall;
4848
/* Version number for use by specializer.
4949
* Can set to non-zero when we want to specialize.

Include/internal/pycore_interpframe.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ static inline void _PyFrame_Copy(_PyInterpreterFrame *src, _PyInterpreterFrame *
161161
}
162162

163163
/* Generator frames need a strong reference to the code object */
164-
static inline void _PyFrame_CopyForGenerators(_PyInterpreterFrame *old_frame, _PyInterpreterFrame *gen_frame) {
164+
static inline void
165+
_PyFrame_CopyForGenerators(_PyInterpreterFrame *old_frame, _PyInterpreterFrame *gen_frame)
166+
{
165167
_PyFrame_Copy(old_frame, gen_frame);
166168
gen_frame->owner = FRAME_OWNED_BY_GENERATOR;
167169
gen_frame->f_executable = PyStackRef_MakeHeapSafe(gen_frame->f_executable);

Include/internal/pycore_interpframe_structs.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ enum _frameowner {
2727
};
2828

2929
struct _PyInterpreterFrame {
30-
_PyStackRef f_executable; /* Borrowed reference (code object or None) */
30+
/* Borrowed reference (code object or None) */
31+
/* Strong reference for generators */
32+
_PyStackRef f_executable;
3133
struct _PyInterpreterFrame *previous;
3234
_PyStackRef f_funcobj; /* Deferred or strong reference. Only valid if not on C stack */
3335
PyObject *f_globals; /* Borrowed reference. Only valid if not on C stack */
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
Avoid reference counting of :class:`code` objects when creating and destroying
1+
Avoid reference counting of :class:`code` objects when creating and destroying
22
frames by having functions retain a list of all past :class:`code` objects.
3+

0 commit comments

Comments
 (0)