Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Modules/_dbmmodule.c
Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
corona10 and vstinner committed Jun 15, 2020
commit b325856a59a7b0f7b65a3b3c99475403626b94a8
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.
Comment thread
corona10 marked this conversation as resolved.
.flags = Py_TPFLAGS_DEFAULT,
Comment thread
corona10 marked this conversation as resolved.
.slots = dbmtype_spec_slots,
};
Expand Down