Skip to content

Commit b325856

Browse files
corona10vstinner
andcommitted
Update Modules/_dbmmodule.c
Co-authored-by: Victor Stinner <[email protected]>
1 parent 87a6ef1 commit b325856

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Modules/_dbmmodule.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -414,10 +414,9 @@ static PyType_Slot dbmtype_spec_slots[] = {
414414
static PyType_Spec dbmtype_spec = {
415415
.name = "_dbm.dbm",
416416
.basicsize = sizeof(dbmobject),
417-
/*
418-
Calling PyType_GetModuleState() is safe
419-
because Py_TPFLAGS_BASETYPE flag is not used.
420-
*/
417+
// Calling PyType_GetModuleState() on a subclass is not safe.
418+
// dbmtype_spec does not have Py_TPFLAGS_BASETYPE flag which prevents to create a subclass.
419+
// So calling PyType_GetModuleState() in this file is always safe.
421420
.flags = Py_TPFLAGS_DEFAULT,
422421
.slots = dbmtype_spec_slots,
423422
};

0 commit comments

Comments
 (0)