Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3831b0a

Browse files
Issue #29083: Fixed the declaration of some public API functions.
PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and Py_BuildValue() were not available in limited API of version < 3.3 when PY_SSIZE_T_CLEAN is defined.
2 parents 4102d25 + 07a1f65 commit 3831b0a

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

Include/modsupport.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ extern "C" {
1515
#define PyArg_Parse _PyArg_Parse_SizeT
1616
#define PyArg_ParseTuple _PyArg_ParseTuple_SizeT
1717
#define PyArg_ParseTupleAndKeywords _PyArg_ParseTupleAndKeywords_SizeT
18-
#ifndef Py_LIMITED_API
1918
#define PyArg_VaParse _PyArg_VaParse_SizeT
2019
#define PyArg_VaParseTupleAndKeywords _PyArg_VaParseTupleAndKeywords_SizeT
21-
#endif /* !Py_LIMITED_API */
2220
#define Py_BuildValue _Py_BuildValue_SizeT
2321
#define Py_VaBuildValue _Py_VaBuildValue_SizeT
2422
#else
@@ -33,18 +31,18 @@ PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char *, ...);
3331
PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...);
3432
PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,
3533
const char *, char **, ...);
34+
PyAPI_FUNC(int) PyArg_VaParse(PyObject *, const char *, va_list);
35+
PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *,
36+
const char *, char **, va_list);
37+
#endif
3638
PyAPI_FUNC(int) PyArg_ValidateKeywordArguments(PyObject *);
3739
PyAPI_FUNC(int) PyArg_UnpackTuple(PyObject *, const char *, Py_ssize_t, Py_ssize_t, ...);
3840
PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...);
3941
PyAPI_FUNC(PyObject *) _Py_BuildValue_SizeT(const char *, ...);
40-
#endif
42+
4143
#ifndef Py_LIMITED_API
4244
PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kw);
4345
PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args);
44-
45-
PyAPI_FUNC(int) PyArg_VaParse(PyObject *, const char *, va_list);
46-
PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *,
47-
const char *, char **, va_list);
4846
#endif
4947
PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list);
5048

Misc/NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ Windows
143143
C API
144144
-----
145145

146+
- Issue #29083: Fixed the declaration of some public API functions.
147+
PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in
148+
limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and
149+
Py_BuildValue() were not available in limited API of version < 3.3 when
150+
PY_SSIZE_T_CLEAN is defined.
151+
146152
- Issue #29058: All stable API extensions added after Python 3.2 are now
147153
available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of
148154
the minimum Python version supporting this API.

0 commit comments

Comments
 (0)