Skip to content

Commit 2b67fc5

Browse files
authored
gh-108494: Fix Argument Clinic LIMITED_CAPI_REGEX (#116610)
Accept spaces in "# define Py_LIMITED_API 0x030d0000".
1 parent 06e29a2 commit 2b67fc5

File tree

13 files changed

+26
-36
lines changed

13 files changed

+26
-36
lines changed

Modules/_ctypes/_ctypes_test.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
12
#include "pyconfig.h" // Py_GIL_DISABLED
2-
33
#ifndef Py_GIL_DISABLED
4-
// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
5-
#define Py_LIMITED_API 0x030c0000
4+
# define Py_LIMITED_API 0x030c0000
65
#endif
76

87
// gh-85283: On Windows, Py_LIMITED_API requires Py_BUILD_CORE to not attempt

Modules/_multiprocessing/posixshmem.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
posixshmem - A Python extension that provides shm_open() and shm_unlink()
33
*/
44

5+
// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
56
#include "pyconfig.h" // Py_GIL_DISABLED
6-
77
#ifndef Py_GIL_DISABLED
8-
// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
9-
#define Py_LIMITED_API 0x030c0000
8+
# define Py_LIMITED_API 0x030c0000
109
#endif
1110

1211
#include <Python.h>

Modules/_scproxy.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
* using the SystemConfiguration framework.
44
*/
55

6+
// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
67
#include "pyconfig.h" // Py_GIL_DISABLED
7-
88
#ifndef Py_GIL_DISABLED
9-
// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
10-
#define Py_LIMITED_API 0x030c0000
9+
# define Py_LIMITED_API 0x030c0000
1110
#endif
1211

1312
#include <Python.h>

Modules/_stat.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111
*
1212
*/
1313

14+
// Need limited C API version 3.13 for PyModule_Add() on Windows
1415
#include "pyconfig.h" // Py_GIL_DISABLED
15-
1616
#ifndef Py_GIL_DISABLED
17-
// Need limited C API version 3.13 for PyModule_Add() on Windows
18-
#define Py_LIMITED_API 0x030d0000
17+
# define Py_LIMITED_API 0x030d0000
1918
#endif
2019

2120
#include "Python.h"

Modules/_testclinic_limited.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
#undef Py_BUILD_CORE_MODULE
55
#undef Py_BUILD_CORE_BUILTIN
66

7+
// For now, AC only supports the limited C API version 3.13
78
#include "pyconfig.h" // Py_GIL_DISABLED
8-
99
#ifndef Py_GIL_DISABLED
10-
// For now, only limited C API 3.13 is supported
11-
#define Py_LIMITED_API 0x030d0000
10+
# define Py_LIMITED_API 0x030d0000
1211
#endif
1312

1413
/* Always enable assertions */

Modules/_testimportmultiple.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
*/
66

77
#include "pyconfig.h" // Py_GIL_DISABLED
8-
98
#ifndef Py_GIL_DISABLED
10-
#define Py_LIMITED_API 0x03020000
9+
# define Py_LIMITED_API 0x03020000
1110
#endif
1211

1312
#include <Python.h>

Modules/_uuidmodule.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
* DCE compatible Universally Unique Identifier library.
44
*/
55

6+
// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
67
#include "pyconfig.h" // Py_GIL_DISABLED
7-
88
#ifndef Py_GIL_DISABLED
9-
// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
10-
#define Py_LIMITED_API 0x030c0000
9+
# define Py_LIMITED_API 0x030c0000
1110
#endif
1211

1312
#include "Python.h"

Modules/errnomodule.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
/* Errno module */
22

3+
// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
34
#include "pyconfig.h" // Py_GIL_DISABLED
4-
55
#ifndef Py_GIL_DISABLED
6-
// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
7-
#define Py_LIMITED_API 0x030c0000
6+
# define Py_LIMITED_API 0x030c0000
87
#endif
98

109
#include "Python.h"

Modules/resource.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
// Need limited C API version 3.13 for PySys_Audit()
12
#include "pyconfig.h" // Py_GIL_DISABLED
2-
33
#ifndef Py_GIL_DISABLED
4-
// Need limited C API version 3.13 for PySys_Audit()
5-
#define Py_LIMITED_API 0x030d0000
4+
# define Py_LIMITED_API 0x030d0000
65
#endif
76

87
#include "Python.h"

Modules/xxlimited.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@
6262
pass
6363
*/
6464

65+
// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
6566
#include "pyconfig.h" // Py_GIL_DISABLED
66-
6767
#ifndef Py_GIL_DISABLED
68-
// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
69-
#define Py_LIMITED_API 0x030c0000
68+
# define Py_LIMITED_API 0x030c0000
7069
#endif
7170

7271
#include "Python.h"

0 commit comments

Comments
 (0)