Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
gh-96641: Do not expose KeyWrapper in _functoolsmodule.c (gh-96642)
(cherry picked from commit 2fd7246)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
  • Loading branch information
sobolevn authored and miss-islington committed Sep 7, 2022
commit 945b8f79189431afe9eb07dbad5a81592c47f38c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Do not expose ``KeyWrapper`` in :mod:`_functools`.
5 changes: 2 additions & 3 deletions Modules/_functoolsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1470,9 +1470,8 @@ _functools_exec(PyObject *module)
if (state->keyobject_type == NULL) {
return -1;
}
if (PyModule_AddType(module, state->keyobject_type) < 0) {
return -1;
}
// keyobject_type is used only internally.
// So we don't expose it in module namespace.

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