Skip to content

Commit b325856

Browse files
corona10vstinner
andcommitted
Update Modules/_dbmmodule.c
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 87a6ef1 commit b325856

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Modules/_dbmmodule.c

Lines changed: 3 additions & 4 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy