]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-107211: Rename PySymtable_Lookup() to _PySymtable_Lookup() (#107212)
authorVictor Stinner <vstinner@python.org>
Tue, 25 Jul 2023 00:54:09 +0000 (02:54 +0200)
committerGitHub <noreply@github.com>
Tue, 25 Jul 2023 00:54:09 +0000 (00:54 +0000)
Rename the internal PySymtable_Lookup() function to
_PySymtable_Lookup() and no longer export it.

Include/internal/pycore_symtable.h
Python/compile.c
Python/symtable.c

index c8e0578a231756c1bdc02e3e46dc2d01292a8c83..1d782ca2c96e055a904dd8b5e7b726d67cf59bc2 100644 (file)
@@ -101,7 +101,7 @@ extern struct symtable* _PySymtable_Build(
     struct _mod *mod,
     PyObject *filename,
     PyFutureFeatures *future);
-PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *);
+extern PySTEntryObject* _PySymtable_Lookup(struct symtable *, void *);
 
 extern void _PySymtable_Free(struct symtable *);
 
index 600118768e639299e689ec68dd4b89f150bd72d8..5915a4bc2f81b032d61debdc44d2bb2de7b0e45d 100644 (file)
@@ -1280,7 +1280,7 @@ compiler_enter_scope(struct compiler *c, identifier name,
     u->u_metadata.u_argcount = 0;
     u->u_metadata.u_posonlyargcount = 0;
     u->u_metadata.u_kwonlyargcount = 0;
-    u->u_ste = PySymtable_Lookup(c->c_st, key);
+    u->u_ste = _PySymtable_Lookup(c->c_st, key);
     if (!u->u_ste) {
         compiler_unit_free(u);
         return ERROR;
@@ -5685,7 +5685,7 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type,
     comprehension_ty outermost;
     int scope_type = c->u->u_scope_type;
     int is_top_level_await = IS_TOP_LEVEL_AWAIT(c);
-    PySTEntryObject *entry = PySymtable_Lookup(c->c_st, (void *)e);
+    PySTEntryObject *entry = _PySymtable_Lookup(c->c_st, (void *)e);
     if (entry == NULL) {
         goto error;
     }
index e2c00d17480dd135414ee171b9e0175f8f519a6c..2407367a58a9b01d4b11396a390afea547762612 100644 (file)
@@ -389,7 +389,7 @@ _PySymtable_Free(struct symtable *st)
 }
 
 PySTEntryObject *
-PySymtable_Lookup(struct symtable *st, void *key)
+_PySymtable_Lookup(struct symtable *st, void *key)
 {
     PyObject *k, *v;