]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44256: Do not expose _functools._list_elem_type (GH-26416)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 28 May 2021 07:10:45 +0000 (00:10 -0700)
committerGitHub <noreply@github.com>
Fri, 28 May 2021 07:10:45 +0000 (16:10 +0900)
It is internal use only type.
(cherry picked from commit 28be3191a9db2769ed05e55c6bcbccdd029656dd)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
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;
 }