Skip to content

Commit

Permalink
Use PyObject_VAR_HEAD for generator objects
Browse files Browse the repository at this point in the history
  • Loading branch information
jbower-fb committed Nov 8, 2024
1 parent 06a8b0b commit 5a44669
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Include/internal/pycore_genobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extern "C" {
/* _PyGenObject_HEAD defines the initial segment of generator
and coroutine objects. */
#define _PyGenObject_HEAD(prefix) \
PyObject_HEAD \
PyObject_VAR_HEAD \
/* List of weak reference. */ \
PyObject *prefix##_weakreflist; \
/* Name of the generator. */ \
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -1641,7 +1641,7 @@ def bar(cls):
check(bar, size('PP'))
# generator
def get_gen(): yield 1
check(get_gen(), size('6P4c' + INTERPRETER_FRAME + 'P'))
check(get_gen(), size('7P4c' + INTERPRETER_FRAME + 'P'))
# iterator
check(iter('abc'), size('lP'))
# callable-iterator
Expand Down

0 comments on commit 5a44669

Please sign in to comment.