]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106320: Remove private _PyErr_SetKeyError() (#108607)
authorVictor Stinner <vstinner@python.org>
Tue, 29 Aug 2023 03:13:41 +0000 (05:13 +0200)
committerGitHub <noreply@github.com>
Tue, 29 Aug 2023 03:13:41 +0000 (03:13 +0000)
Move the private _PyErr_SetKeyError() function to the internal C API
(pycore_pyerrors.h).

Include/cpython/pyerrors.h
Include/internal/pycore_pyerrors.h
Objects/setobject.c

index 5c128211bd525a74214bf1b1606f9bc03fe90a63..cbe3be158b38beba4cc9a6b5ea2946b470d9cf92 100644 (file)
@@ -88,10 +88,6 @@ typedef PyOSErrorObject PyEnvironmentErrorObject;
 typedef PyOSErrorObject PyWindowsErrorObject;
 #endif
 
-/* Error handling definitions */
-
-PyAPI_FUNC(void) _PyErr_SetKeyError(PyObject *);
-
 /* Context manipulation (PEP 3134) */
 
 Py_DEPRECATED(3.12) PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *);
index 5d2ad50e0d2cfdb547bf584115ac2da5ff7936f6..0bc20589721f351ca4c1e0e4793a867889ef7ce9 100644 (file)
@@ -16,6 +16,10 @@ extern PyObject* _PyErr_GetHandledException(PyThreadState *);
 extern void _PyErr_SetHandledException(PyThreadState *, PyObject *);
 extern void _PyErr_GetExcInfo(PyThreadState *, PyObject **, PyObject **, PyObject **);
 
+// Export for '_testinternalcapi' shared extension
+PyAPI_FUNC(void) _PyErr_SetKeyError(PyObject *);
+
+
 // Like PyErr_Format(), but saves current exception as __context__ and
 // __cause__.
 // Export for '_sqlite3' shared extension.
index 14b53c12dda57f22fc9a3cea9490b002f8c11e38..6051e57731c7a3abfda887562679c3149589e93d 100644 (file)
@@ -36,6 +36,7 @@
 #include "pycore_dict.h"          // _PyDict_Contains_KnownHash()
 #include "pycore_modsupport.h"    // _PyArg_NoKwnames()
 #include "pycore_object.h"        // _PyObject_GC_UNTRACK()
+#include "pycore_pyerrors.h"      // _PyErr_SetKeyError()
 #include "pycore_setobject.h"     // _PySet_NextEntry() definition
 #include <stddef.h>               // offsetof()