diff --git a/Include/internal/pycore_genobject.h b/Include/internal/pycore_genobject.h index f6d7e6d367177b..359253efc7a028 100644 --- a/Include/internal/pycore_genobject.h +++ b/Include/internal/pycore_genobject.h @@ -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. */ \ diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index d839893d2c657e..7328f4eadef37c 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -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