summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-08-24 20:02:09 (GMT)
committerGitHub <noreply@github.com>2023-08-24 20:02:09 (GMT)
commita071ecb4d13595f3580cf82061dcd7b39cd475c5 (patch)
treec744a2942c27476f0cd5c71faf336ad64142756a /Python
parent26893016a7f204b2e7138fc9ce04525a651c202e (diff)
downloadcpython-a071ecb4d13595f3580cf82061dcd7b39cd475c5.zip
cpython-a071ecb4d13595f3580cf82061dcd7b39cd475c5.tar.gz
cpython-a071ecb4d13595f3580cf82061dcd7b39cd475c5.tar.bz2
gh-106320: Remove private _PySys functions (#108452)
Move private functions to the internal C API (pycore_sysmodule.h): * _PySys_GetAttr() * _PySys_GetSizeOf() No longer export most of these functions. Fix also a typo in Include/cpython/optimizer.h: add a missing space.
Diffstat (limited to 'Python')
-rw-r--r--Python/_warnings.c2
-rw-r--r--Python/bltinmodule.c1
-rw-r--r--Python/intrinsics.c3
-rw-r--r--Python/sysmodule.c1
-rw-r--r--Python/traceback.c1
5 files changed, 7 insertions, 1 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 40ec5f6..9e562d7 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -7,6 +7,8 @@
#include "pycore_pyerrors.h"
#include "pycore_pylifecycle.h" // _Py_IsInterpreterFinalizing()
#include "pycore_pystate.h" // _PyThreadState_GET()
+#include "pycore_sysmodule.h" // _PySys_GetAttr()
+
#include "clinic/_warnings.c.h"
#define MODULE_NAME "_warnings"
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 787f53f..ac9bc72 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -12,6 +12,7 @@
#include "pycore_object.h" // _Py_AddToAllObjects()
#include "pycore_pyerrors.h" // _PyErr_NoMemory()
#include "pycore_pystate.h" // _PyThreadState_GET()
+#include "pycore_sysmodule.h" // _PySys_GetAttr()
#include "pycore_tuple.h" // _PyTuple_FromArray()
#include "clinic/bltinmodule.c.h"
diff --git a/Python/intrinsics.c b/Python/intrinsics.c
index 5267c10..fefee0f 100644
--- a/Python/intrinsics.c
+++ b/Python/intrinsics.c
@@ -4,10 +4,11 @@
#include "Python.h"
#include "pycore_frame.h"
#include "pycore_function.h"
-#include "pycore_runtime.h"
#include "pycore_global_objects.h"
#include "pycore_intrinsics.h"
#include "pycore_pyerrors.h"
+#include "pycore_runtime.h"
+#include "pycore_sysmodule.h" // _PySys_GetAttr()
#include "pycore_typevarobject.h"
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 94d0f01..0ec763c 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -31,6 +31,7 @@ Data members:
#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator()
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "pycore_structseq.h" // _PyStructSequence_InitBuiltinWithFlags()
+#include "pycore_sysmodule.h" // Define _PySys_GetSizeOf()
#include "pycore_tuple.h" // _PyTuple_FromArray()
#include "frameobject.h" // PyFrame_FastToLocalsWithError()
diff --git a/Python/traceback.c b/Python/traceback.c
index 61ace38..657ddab 100644
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -13,6 +13,7 @@
#include "pycore_pyarena.h" // _PyArena_Free()
#include "pycore_pyerrors.h" // _PyErr_GetRaisedException()
#include "pycore_pystate.h" // _PyThreadState_GET()
+#include "pycore_sysmodule.h" // _PySys_GetAttr()
#include "pycore_traceback.h" // EXCEPTION_TB_HEADER
#include "../Parser/pegen.h" // _PyPegen_byte_offset_to_character_offset()