summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-08-26 00:24:27 (GMT)
committerGitHub <noreply@github.com>2023-08-26 00:24:27 (GMT)
commit713afb8804666405f29115cf459b591308e3ab54 (patch)
treedb6bdfbbf19f1b222c4d6a6e027efd6a4202e96c /Modules
parent86bc9e35c4aaf3bcc045ddd998844ffb64fec3a2 (diff)
downloadcpython-713afb8804666405f29115cf459b591308e3ab54.zip
cpython-713afb8804666405f29115cf459b591308e3ab54.tar.gz
cpython-713afb8804666405f29115cf459b591308e3ab54.tar.bz2
gh-106320: Remove private _PyLong converter functions (#108499)
Move these private functions to the internal C API (pycore_long.h): * _PyLong_UnsignedInt_Converter() * _PyLong_UnsignedLongLong_Converter() * _PyLong_UnsignedLong_Converter() * _PyLong_UnsignedShort_Converter() Argument Clinic now emits #include "pycore_long.h" when these functions are used.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_blake2/clinic/blake2b_impl.c.h3
-rw-r--r--Modules/_blake2/clinic/blake2s_impl.c.h3
-rw-r--r--Modules/clinic/_testclinic.c.h3
-rw-r--r--Modules/clinic/_testclinic_depr.c.h3
-rw-r--r--Modules/clinic/overlapped.c.h3
-rw-r--r--Modules/clinic/posixmodule.c.h3
-rw-r--r--Modules/clinic/selectmodule.c.h3
-rw-r--r--Modules/clinic/sha3module.c.h3
-rw-r--r--Modules/overlapped.c5
9 files changed, 20 insertions, 9 deletions
diff --git a/Modules/_blake2/clinic/blake2b_impl.c.h b/Modules/_blake2/clinic/blake2b_impl.c.h
index 284cccf..384e714 100644
--- a/Modules/_blake2/clinic/blake2b_impl.c.h
+++ b/Modules/_blake2/clinic/blake2b_impl.c.h
@@ -7,6 +7,7 @@ preserve
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_long.h" // _PyLong_UnsignedLong_Converter()
PyDoc_STRVAR(py_blake2b_new__doc__,
"blake2b(data=b\'\', /, *, digest_size=_blake2.blake2b.MAX_DIGEST_SIZE,\n"
@@ -276,4 +277,4 @@ _blake2_blake2b_hexdigest(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored))
{
return _blake2_blake2b_hexdigest_impl(self);
}
-/*[clinic end generated code: output=76bbcf5f220511b9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=48128782266b7b8e input=a9049054013a1b77]*/
diff --git a/Modules/_blake2/clinic/blake2s_impl.c.h b/Modules/_blake2/clinic/blake2s_impl.c.h
index 5b6af84..d7a4752 100644
--- a/Modules/_blake2/clinic/blake2s_impl.c.h
+++ b/Modules/_blake2/clinic/blake2s_impl.c.h
@@ -7,6 +7,7 @@ preserve
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_long.h" // _PyLong_UnsignedLong_Converter()
PyDoc_STRVAR(py_blake2s_new__doc__,
"blake2s(data=b\'\', /, *, digest_size=_blake2.blake2s.MAX_DIGEST_SIZE,\n"
@@ -276,4 +277,4 @@ _blake2_blake2s_hexdigest(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored))
{
return _blake2_blake2s_hexdigest_impl(self);
}
-/*[clinic end generated code: output=af69b321be0b4a77 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=2188af9910a45497 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_testclinic.c.h b/Modules/clinic/_testclinic.c.h
index d3a0646..3c04c41 100644
--- a/Modules/clinic/_testclinic.c.h
+++ b/Modules/clinic/_testclinic.c.h
@@ -7,6 +7,7 @@ preserve
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_long.h" // _PyLong_UnsignedShort_Converter()
PyDoc_STRVAR(test_empty_function__doc__,
"test_empty_function($module, /)\n"
@@ -3069,4 +3070,4 @@ skip_optional_pos:
exit:
return return_value;
}
-/*[clinic end generated code: output=86396cbed6eb8b65 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=41f439aab0cb809d input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_testclinic_depr.c.h b/Modules/clinic/_testclinic_depr.c.h
index b8365bd..71cb972 100644
--- a/Modules/clinic/_testclinic_depr.c.h
+++ b/Modules/clinic/_testclinic_depr.c.h
@@ -7,6 +7,7 @@ preserve
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_long.h" // _PyLong_UnsignedShort_Converter()
PyDoc_STRVAR(depr_star_new__doc__,
"DeprStarNew(a=None)\n"
@@ -2391,4 +2392,4 @@ depr_multi(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *
exit:
return return_value;
}
-/*[clinic end generated code: output=ee8b1933e4bf4dc4 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=22b59d92d517a8ec input=a9049054013a1b77]*/
diff --git a/Modules/clinic/overlapped.c.h b/Modules/clinic/overlapped.c.h
index b6c5f79..100df20 100644
--- a/Modules/clinic/overlapped.c.h
+++ b/Modules/clinic/overlapped.c.h
@@ -7,6 +7,7 @@ preserve
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_long.h" // _PyLong_UnsignedLong_Converter()
PyDoc_STRVAR(_overlapped_CreateIoCompletionPort__doc__,
"CreateIoCompletionPort($module, handle, port, key, concurrency, /)\n"
@@ -1262,4 +1263,4 @@ exit:
return return_value;
}
-/*[clinic end generated code: output=9fbc01f706562dea input=a9049054013a1b77]*/
+/*[clinic end generated code: output=994ad727b827ff87 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h
index db82916..ae3c1d6 100644
--- a/Modules/clinic/posixmodule.c.h
+++ b/Modules/clinic/posixmodule.c.h
@@ -7,6 +7,7 @@ preserve
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_long.h" // _PyLong_UnsignedInt_Converter()
PyDoc_STRVAR(os_stat__doc__,
"stat($module, /, path, *, dir_fd=None, follow_symlinks=True)\n"
@@ -11990,4 +11991,4 @@ exit:
#ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF
#define OS_WAITSTATUS_TO_EXITCODE_METHODDEF
#endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */
-/*[clinic end generated code: output=5e839ce21678ea66 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a08a47b52da6da0b input=a9049054013a1b77]*/
diff --git a/Modules/clinic/selectmodule.c.h b/Modules/clinic/selectmodule.c.h
index bebcc24..f6b3ea3 100644
--- a/Modules/clinic/selectmodule.c.h
+++ b/Modules/clinic/selectmodule.c.h
@@ -7,6 +7,7 @@ preserve
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_long.h" // _PyLong_UnsignedShort_Converter()
PyDoc_STRVAR(select_select__doc__,
"select($module, rlist, wlist, xlist, timeout=None, /)\n"
@@ -1309,4 +1310,4 @@ exit:
#ifndef SELECT_KQUEUE_CONTROL_METHODDEF
#define SELECT_KQUEUE_CONTROL_METHODDEF
#endif /* !defined(SELECT_KQUEUE_CONTROL_METHODDEF) */
-/*[clinic end generated code: output=7521d757ef9e63e8 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a19c29946a931dce input=a9049054013a1b77]*/
diff --git a/Modules/clinic/sha3module.c.h b/Modules/clinic/sha3module.c.h
index 299803a..80fe3ed 100644
--- a/Modules/clinic/sha3module.c.h
+++ b/Modules/clinic/sha3module.c.h
@@ -7,6 +7,7 @@ preserve
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_long.h" // _PyLong_UnsignedLong_Converter()
PyDoc_STRVAR(py_sha3_new__doc__,
"sha3_224(data=b\'\', /, *, usedforsecurity=True)\n"
@@ -193,4 +194,4 @@ _sha3_shake_128_hexdigest(SHA3object *self, PyObject *arg)
exit:
return return_value;
}
-/*[clinic end generated code: output=907cb475f3dc9ee0 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5188d9ae4af48c6d input=a9049054013a1b77]*/
diff --git a/Modules/overlapped.c b/Modules/overlapped.c
index 271f6ce..34be3a4 100644
--- a/Modules/overlapped.c
+++ b/Modules/overlapped.c
@@ -7,8 +7,11 @@
/* XXX check overflow and DWORD <-> Py_ssize_t conversions
Check itemsize */
-#include "Python.h"
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+#include "Python.h"
#define WINDOWS_LEAN_AND_MEAN
#include <winsock2.h>