summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-08-24 16:53:50 (GMT)
committerGitHub <noreply@github.com>2023-08-24 16:53:50 (GMT)
commitc55e73112c7b0574d05a522015d0c927de266525 (patch)
tree8f1035a646c7b94afc0c1f2c250d009c99a37f36 /Modules
parent7f316763402a7d5556deecc3acd06cb719e189b3 (diff)
downloadcpython-c55e73112c7b0574d05a522015d0c927de266525.zip
cpython-c55e73112c7b0574d05a522015d0c927de266525.tar.gz
cpython-c55e73112c7b0574d05a522015d0c927de266525.tar.bz2
gh-106320: Remove private PyLong C API functions (#108429)
Remove private PyLong C API functions: * _PyLong_AsByteArray() * _PyLong_DivmodNear() * _PyLong_Format() * _PyLong_Frexp() * _PyLong_FromByteArray() * _PyLong_FromBytes() * _PyLong_GCD() * _PyLong_Lshift() * _PyLong_Rshift() Move these functions to the internal C API. No longer export _PyLong_FromBytes() function.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_io/_iomodule.c5
-rw-r--r--Modules/_pickle.c1
-rw-r--r--Modules/_randommodule.c2
-rw-r--r--Modules/_sqlite/util.c5
-rw-r--r--Modules/_struct.c1
-rw-r--r--Modules/arraymodule.c3
-rw-r--r--Modules/cjkcodecs/multibytecodec.c1
7 files changed, 14 insertions, 4 deletions
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c
index 1a7920e..f566542 100644
--- a/Modules/_io/_iomodule.c
+++ b/Modules/_io/_iomodule.c
@@ -8,9 +8,10 @@
*/
#include "Python.h"
-#include "_iomodule.h"
-#include "pycore_pystate.h" // _PyInterpreterState_GET()
#include "pycore_initconfig.h" // _PyStatus_OK()
+#include "pycore_pystate.h" // _PyInterpreterState_GET()
+
+#include "_iomodule.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index c2b04cc..4f26ffe 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -11,6 +11,7 @@
#include "Python.h"
#include "pycore_bytesobject.h" // _PyBytesWriter
#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
+#include "pycore_long.h" // _PyLong_AsByteArray()
#include "pycore_moduleobject.h" // _PyModule_GetState()
#include "pycore_object.h" // _PyNone_Type
#include "pycore_pystate.h" // _PyThreadState_GET()
diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c
index 7daa1f9..18811d0 100644
--- a/Modules/_randommodule.c
+++ b/Modules/_randommodule.c
@@ -71,9 +71,9 @@
#endif
#include "Python.h"
+#include "pycore_long.h" // _PyLong_AsByteArray()
#include "pycore_moduleobject.h" // _PyModule_GetState()
#include "pycore_pylifecycle.h" // _PyOS_URandomNonblock()
-#include "pycore_runtime.h"
#ifdef HAVE_PROCESS_H
# include <process.h> // getpid()
#endif
diff --git a/Modules/_sqlite/util.c b/Modules/_sqlite/util.c
index 2b3bbfe..833a666 100644
--- a/Modules/_sqlite/util.c
+++ b/Modules/_sqlite/util.c
@@ -21,7 +21,12 @@
* 3. This notice may not be removed or altered from any source distribution.
*/
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#include "module.h"
+#include "pycore_long.h" // _PyLong_AsByteArray()
#include "connection.h"
// Returns non-NULL if a new exception should be raised
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 425715a..606ae5e 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -9,6 +9,7 @@
#include "Python.h"
#include "pycore_bytesobject.h" // _PyBytesWriter
+#include "pycore_long.h" // _PyLong_AsByteArray()
#include "pycore_moduleobject.h" // _PyModule_GetState()
#include <ctype.h>
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index a40a5b7..5c1e6cb 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -8,9 +8,10 @@
#endif
#include "Python.h"
+#include "pycore_bytesobject.h" // _PyBytes_Repeat
#include "pycore_call.h" // _PyObject_CallMethod()
+#include "pycore_long.h" // _PyLong_FromByteArray()
#include "pycore_moduleobject.h" // _PyModule_GetState()
-#include "pycore_bytesobject.h" // _PyBytes_Repeat
#include <stddef.h> // offsetof()
#include <stdbool.h>
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c
index 5d3c16a..7c1da90 100644
--- a/Modules/cjkcodecs/multibytecodec.c
+++ b/Modules/cjkcodecs/multibytecodec.c
@@ -9,6 +9,7 @@
#endif
#include "Python.h"
+#include "pycore_long.h" // _PyLong_FromByteArray()
#include "multibytecodec.h"
#include "clinic/multibytecodec.c.h"