diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2022-09-07 11:13:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-07 11:13:07 (GMT) |
commit | 2fd7246e97c8cc09b4e3f22933693f9d68f08163 (patch) | |
tree | ef991f3e807c37d0bfc0514a1d638ca666472e6e /Modules/_functoolsmodule.c | |
parent | 0d04b8d9e1953d2311f78b772f21c9e07fbcbb6d (diff) | |
download | cpython-2fd7246e97c8cc09b4e3f22933693f9d68f08163.zip cpython-2fd7246e97c8cc09b4e3f22933693f9d68f08163.tar.gz cpython-2fd7246e97c8cc09b4e3f22933693f9d68f08163.tar.bz2 |
gh-96641: Do not expose `KeyWrapper` in `_functoolsmodule.c` (gh-96642)
Diffstat (limited to 'Modules/_functoolsmodule.c')
-rw-r--r-- | Modules/_functoolsmodule.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index c6d6ca9..3abb7fd 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -1471,9 +1471,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); |