Skip to content

Commit

Permalink
Fix version of ht->ht_module
Browse files Browse the repository at this point in the history
Was added in commit e1becf46b4e3 ("bpo-38787: C API for module state
access from extension methods (PEP 573) (GH-19936)"), hence 3.9.

[1] python/cpython@e1becf4
  • Loading branch information
zhuyifei1999 committed Oct 18, 2023
1 parent 04abb45 commit 746eb90
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/heapy/stdtypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,10 @@ type_traverse(NyHeapTraverse *ta)
Py_VISIT(((PyHeapTypeObject *)type)->ht_name);
Py_VISIT(((PyHeapTypeObject *)type)->ht_slots);
Py_VISIT(((PyHeapTypeObject *)type)->ht_qualname);

#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 9
Py_VISIT(((PyHeapTypeObject *)type)->ht_module);
#endif
return 0;
}

Expand Down Expand Up @@ -587,7 +590,10 @@ type_relate(NyHeapRelate *r)
RENAMEATTR(ht_name, __name__);
RENAMEATTR(ht_slots, __slots__);
RENAMEATTR(ht_qualname, __qualname__);

#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 9
INTERATTR(ht_module);
#endif
return 0;
#undef v
}
Expand Down

0 comments on commit 746eb90

Please sign in to comment.