summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-08-26 01:18:09 (GMT)
committerGitHub <noreply@github.com>2023-08-26 01:18:09 (GMT)
commit6353c21b78a3d91e7cd7810f1c00258a34e85fe7 (patch)
treefdb9e8068ae4f9fd472718cea32dab935b5064a6 /Tools
parent713afb8804666405f29115cf459b591308e3ab54 (diff)
downloadcpython-6353c21b78a3d91e7cd7810f1c00258a34e85fe7.zip
cpython-6353c21b78a3d91e7cd7810f1c00258a34e85fe7.tar.gz
cpython-6353c21b78a3d91e7cd7810f1c00258a34e85fe7.tar.bz2
gh-106320: Remove private _PyLong_FileDescriptor_Converter() (#108503)
Move the private _PyLong converter functions to the internal C API * _PyLong_FileDescriptor_Converter(): moved to pycore_fileutils.h * _PyLong_Size_t_Converter(): moved to pycore_long.h Argument Clinic now emits includes for pycore_fileutils.h and pycore_long.h when these functions are used.
Diffstat (limited to 'Tools')
-rw-r--r--Tools/c-analyzer/c_parser/preprocessor/gcc.py5
-rwxr-xr-xTools/clinic/clinic.py8
2 files changed, 12 insertions, 1 deletions
diff --git a/Tools/c-analyzer/c_parser/preprocessor/gcc.py b/Tools/c-analyzer/c_parser/preprocessor/gcc.py
index 62538f5..de9a248 100644
--- a/Tools/c-analyzer/c_parser/preprocessor/gcc.py
+++ b/Tools/c-analyzer/c_parser/preprocessor/gcc.py
@@ -12,13 +12,16 @@ NEED_BUILD_CORE = {
'multibytecodec.h',
'socketmodule.h',
- # Argument Clinic ".c.h" files
+ # Argument Clinic ".c.h" header files
'_testclinic.c.h',
'_testclinic_depr.c.h',
+ '_winapi.c.h',
+ 'fcntlmodule.c.h',
'overlapped.c.h',
'posixmodule.c.h',
'selectmodule.c.h',
'sha3module.c.h',
+ 'termios.c.h',
}
TOOL = 'gcc'
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index c4304bb..e622d25 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -3835,6 +3835,10 @@ class size_t_converter(CConverter):
converter = '_PyLong_Size_t_Converter'
c_ignored_default = "0"
+ def converter_init(self, *, accept: TypeSet = {int, NoneType}) -> None:
+ self.add_include('pycore_long.h',
+ '_PyLong_Size_t_Converter()')
+
def parse_arg(self, argname: str, displayname: str) -> str | None:
if self.format_unit == 'n':
return """
@@ -3850,6 +3854,10 @@ class fildes_converter(CConverter):
type = 'int'
converter = '_PyLong_FileDescriptor_Converter'
+ def converter_init(self, *, accept: TypeSet = {int, NoneType}) -> None:
+ self.add_include('pycore_fileutils.h',
+ '_PyLong_FileDescriptor_Converter()')
+
def _parse_arg(self, argname: str, displayname: str) -> str | None:
return """
{paramname} = PyObject_AsFileDescriptor({argname});