summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-03-11 22:42:18 (GMT)
committerGitHub <noreply@github.com>2024-03-11 22:42:18 (GMT)
commit2b67fc57f6e97c8389fe970ed232c1ad484113e1 (patch)
tree913984c1a9d4bedfc34ce8de9f1847873b41a51c /Tools
parent06e29a224fac9edeba55422d2e60f2fbb88dddce (diff)
downloadcpython-2b67fc57f6e97c8389fe970ed232c1ad484113e1.zip
cpython-2b67fc57f6e97c8389fe970ed232c1ad484113e1.tar.gz
cpython-2b67fc57f6e97c8389fe970ed232c1ad484113e1.tar.bz2
gh-108494: Fix Argument Clinic LIMITED_CAPI_REGEX (#116610)
Accept spaces in "# define Py_LIMITED_API 0x030d0000".
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/clinic/clinic.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index 8353941..893f4cc 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -66,8 +66,9 @@ from libclinic import ClinicError
#
-# match '#define Py_LIMITED_API'
-LIMITED_CAPI_REGEX = re.compile(r'#define +Py_LIMITED_API')
+# Match '#define Py_LIMITED_API'.
+# Match '# define Py_LIMITED_API 0x030d0000' (without the version).
+LIMITED_CAPI_REGEX = re.compile(r'# *define +Py_LIMITED_API')
class Sentinels(enum.Enum):