diff options
author | Victor Stinner <vstinner@python.org> | 2023-08-22 18:17:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-22 18:17:25 (GMT) |
commit | 615f6e946db6d7eae66b8de9a75a6c58a84516a6 (patch) | |
tree | d94d9365566defdedf9f2cf0deffa8f53b6ae587 /Python | |
parent | 0cb0c238d520a8718e313b52cffc356a5a7561bf (diff) | |
download | cpython-615f6e946db6d7eae66b8de9a75a6c58a84516a6.zip cpython-615f6e946db6d7eae66b8de9a75a6c58a84516a6.tar.gz cpython-615f6e946db6d7eae66b8de9a75a6c58a84516a6.tar.bz2 |
gh-106320: Remove _PyDict_GetItemStringWithError() function (#108313)
Remove private _PyDict_GetItemStringWithError() function of the
public C API: the new PyDict_GetItemStringRef() can be used instead.
* Move private _PyDict_GetItemStringWithError() to the internal C API.
* _testcapi get_code_extra_index() uses PyDict_GetItemStringRef().
Avoid using private functions in _testcapi which tests the public C
API.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/codecs.c | 1 | ||||
-rw-r--r-- | Python/import.c | 3 | ||||
-rw-r--r-- | Python/initconfig.c | 1 | ||||
-rw-r--r-- | Python/pythonrun.c | 1 |
4 files changed, 5 insertions, 1 deletions
diff --git a/Python/codecs.c b/Python/codecs.c index 4e47ff9..3c41851 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -10,6 +10,7 @@ Copyright (c) Corporation for National Research Initiatives. #include "Python.h" #include "pycore_call.h" // _PyObject_CallNoArgs() +#include "pycore_dict.h" // _PyDict_GetItemStringWithError() #include "pycore_interp.h" // PyInterpreterState.codec_search_path #include "pycore_pyerrors.h" // _PyErr_FormatNote() #include "pycore_pystate.h" // _PyInterpreterState_GET() diff --git a/Python/import.c b/Python/import.c index 56b2dc1..4abb2f6 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1,7 +1,7 @@ /* Module definition and import implementation */ #include "Python.h" - +#include "pycore_dict.h" // _PyDict_GetItemStringWithError() #include "pycore_hashtable.h" // _Py_hashtable_new_full() #include "pycore_import.h" // _PyImport_BootstrapImp() #include "pycore_initconfig.h" // _PyStatus_OK() @@ -15,6 +15,7 @@ #include "pycore_pystate.h" // _PyInterpreterState_GET() #include "pycore_sysmodule.h" // _PySys_Audit() #include "pycore_weakref.h" // _PyWeakref_GET_REF() + #include "marshal.h" // PyMarshal_ReadObjectFromString() #include "importdl.h" // _PyImport_DynLoadFiletab #include "pydtrace.h" // PyDTrace_IMPORT_FIND_LOAD_START_ENABLED() diff --git a/Python/initconfig.c b/Python/initconfig.c index 787e583..c017abe 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -1,4 +1,5 @@ #include "Python.h" +#include "pycore_dict.h" // _PyDict_GetItemStringWithError() #include "pycore_fileutils.h" // _Py_HasFileSystemDefaultEncodeErrors #include "pycore_getopt.h" // _PyOS_GetOpt() #include "pycore_initconfig.h" // _PyStatus_OK() diff --git a/Python/pythonrun.c b/Python/pythonrun.c index b2e04cf..a3de779 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -15,6 +15,7 @@ #include "pycore_ast.h" // PyAST_mod2obj #include "pycore_ceval.h" // _Py_EnterRecursiveCall #include "pycore_compile.h" // _PyAST_Compile() +#include "pycore_dict.h" // _PyDict_GetItemStringWithError() #include "pycore_interp.h" // PyInterpreterState.importlib #include "pycore_object.h" // _PyDebug_PrintTotalRefs() #include "pycore_parser.h" // _PyParser_ASTFromString() |