Skip to content

Commit

Permalink
Update Modules/_dbmmodule.c
Browse files Browse the repository at this point in the history
Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
corona10 and vstinner committed Jun 15, 2020
1 parent 87a6ef1 commit b325856
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Modules/_dbmmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,9 @@ static PyType_Slot dbmtype_spec_slots[] = {
static PyType_Spec dbmtype_spec = {
.name = "_dbm.dbm",
.basicsize = sizeof(dbmobject),
/*
Calling PyType_GetModuleState() is safe
because Py_TPFLAGS_BASETYPE flag is not used.
*/
// Calling PyType_GetModuleState() on a subclass is not safe.
// dbmtype_spec does not have Py_TPFLAGS_BASETYPE flag which prevents to create a subclass.
// So calling PyType_GetModuleState() in this file is always safe.
.flags = Py_TPFLAGS_DEFAULT,
.slots = dbmtype_spec_slots,
};
Expand Down

0 comments on commit b325856

Please sign in to comment.