Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b325856

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

File tree

1 file changed

+3
-4
lines changed
Filter options

1 file changed

+3
-4
lines changed

‎Modules/_dbmmodule.c

Copy file name to clipboardExpand all lines: Modules/_dbmmodule.c
+3-4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.