gh-96641: Do not expose KeyWrapper in _functoolsmodule.c (gh-96642)

(cherry picked from commit 2fd7246e97)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
Miss Islington (bot) 2022-09-07 04:50:15 -07:00 committed by GitHub
parent b6af933716
commit eecbb54b62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -0,0 +1 @@
Do not expose ``KeyWrapper`` in :mod:`_functools`.

View file

@ -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);