]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44256: Do not expose _functools._list_elem_type (GH-26416)
authorInada Naoki <songofacandy@gmail.com>
Fri, 28 May 2021 05:09:32 +0000 (14:09 +0900)
committerGitHub <noreply@github.com>
Fri, 28 May 2021 05:09:32 +0000 (14:09 +0900)
It is internal use only type.

Modules/_functoolsmodule.c

index 19cfa9b07b340d62ee6252a44bdb48cdc9670b70..1cfb08caef54ddea866c5459a8e72924118db0ea 100644 (file)
@@ -1460,9 +1460,8 @@ _functools_exec(PyObject *module)
     if (state->lru_list_elem_type == NULL) {
         return -1;
     }
-    if (PyModule_AddType(module, state->lru_list_elem_type) < 0) {
-        return -1;
-    }
+    // lru_list_elem is used only in _lru_cache_wrapper.
+    // So we don't expose it in module namespace.
 
     return 0;
 }