Skip to content

Commit 2fd7246

Browse files
authored
gh-96641: Do not expose KeyWrapper in _functoolsmodule.c (gh-96642)
1 parent 0d04b8d commit 2fd7246

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Do not expose ``KeyWrapper`` in :mod:`_functools`.

Modules/_functoolsmodule.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -1471,9 +1471,8 @@ _functools_exec(PyObject *module)
14711471
if (state->keyobject_type == NULL) {
14721472
return -1;
14731473
}
1474-
if (PyModule_AddType(module, state->keyobject_type) < 0) {
1475-
return -1;
1476-
}
1474+
// keyobject_type is used only internally.
1475+
// So we don't expose it in module namespace.
14771476

14781477
state->lru_list_elem_type = (PyTypeObject *)PyType_FromModuleAndSpec(
14791478
module, &lru_list_elem_type_spec, NULL);

0 commit comments

Comments
 (0)