summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Include/cpython/traceback.h3
-rw-r--r--Include/internal/pycore_traceback.h6
-rw-r--r--Modules/_ctypes/callproc.c6
-rw-r--r--Modules/pyexpat.c1
-rw-r--r--Python/_warnings.c5
5 files changed, 13 insertions, 8 deletions
diff --git a/Include/cpython/traceback.h b/Include/cpython/traceback.h
index a4e087b..81c5194 100644
--- a/Include/cpython/traceback.h
+++ b/Include/cpython/traceback.h
@@ -11,6 +11,3 @@ struct _traceback {
int tb_lasti;
int tb_lineno;
};
-
-PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, PyObject *, int, int, int *, PyObject **);
-PyAPI_FUNC(void) _PyTraceback_Add(const char *, const char *, int);
diff --git a/Include/internal/pycore_traceback.h b/Include/internal/pycore_traceback.h
index 21fb4a2..01b3f5b 100644
--- a/Include/internal/pycore_traceback.h
+++ b/Include/internal/pycore_traceback.h
@@ -8,6 +8,12 @@ extern "C" {
# error "this header requires Py_BUILD_CORE define"
#endif
+// Export for '_ctypes' shared extension
+PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, PyObject *, int, int, int *, PyObject **);
+
+// Export for 'pyexact' shared extension
+PyAPI_FUNC(void) _PyTraceback_Add(const char *, const char *, int);
+
/* Write the Python traceback into the file 'fd'. For example:
Traceback (most recent call first):
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index f9535db..fc08c42 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -101,8 +101,10 @@ module _ctypes
#define DONT_USE_SEH
#endif
-#include "pycore_runtime.h" // _PyRuntime
-#include "pycore_global_objects.h" // _Py_ID()
+#include "pycore_runtime.h" // _PyRuntime
+#include "pycore_global_objects.h"// _Py_ID()
+#include "pycore_traceback.h" // _PyTraceback_Add()
+
#include "clinic/callproc.c.h"
#define CTYPES_CAPSULE_NAME_PYMEM "_ctypes pymem"
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
index a8ce84c..52dd06c 100644
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -5,6 +5,7 @@
#include "Python.h"
#include "pycore_import.h" // _PyImport_SetModule()
#include "pycore_pyhash.h" // _Py_HashSecret
+#include "pycore_traceback.h" // _PyTraceback_Add()
#include <ctype.h>
#include <stddef.h> // offsetof()
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 9e562d7..4b7fb88 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -1,13 +1,12 @@
#include "Python.h"
#include "pycore_dict.h" // _PyDict_GetItemWithError()
-#include "pycore_frame.h"
-#include "pycore_initconfig.h"
#include "pycore_interp.h" // PyInterpreterState.warnings
#include "pycore_long.h" // _PyLong_GetZero()
-#include "pycore_pyerrors.h"
+#include "pycore_pyerrors.h" // _PyErr_Occurred()
#include "pycore_pylifecycle.h" // _Py_IsInterpreterFinalizing()
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "pycore_sysmodule.h" // _PySys_GetAttr()
+#include "pycore_traceback.h" // _Py_DisplaySourceLine()
#include "clinic/_warnings.c.h"