Skip to content

Commit

Permalink
Remove ANY_VARARGS() macro from the C API (#93764)
Browse files Browse the repository at this point in the history
The macro was exposed by mistake.
  • Loading branch information
vstinner authored Jun 13, 2022
1 parent 272bec4 commit 65ac273
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Include/cpython/modsupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args);
#define _PyArg_NoPositional(funcname, args) \
((args) == NULL || _PyArg_NoPositional((funcname), (args)))

#define _Py_ANY_VARARGS(n) (n == PY_SSIZE_T_MAX)

PyAPI_FUNC(void) _PyArg_BadArgument(const char *, const char *, const char *, PyObject *);
PyAPI_FUNC(int) _PyArg_CheckPositional(const char *, Py_ssize_t,
Py_ssize_t, Py_ssize_t);
#define _PyArg_CheckPositional(funcname, nargs, min, max) \
((!ANY_VARARGS(max) && (min) <= (nargs) && (nargs) <= (max)) \
((!_Py_ANY_VARARGS(max) && (min) <= (nargs) && (nargs) <= (max)) \
|| _PyArg_CheckPositional((funcname), (nargs), (min), (max)))

PyAPI_FUNC(PyObject **) _Py_VaBuildStack(
Expand Down
2 changes: 0 additions & 2 deletions Include/modsupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...);
PyAPI_FUNC(PyObject *) _Py_BuildValue_SizeT(const char *, ...);


#define ANY_VARARGS(n) (n == PY_SSIZE_T_MAX)

PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list);

// Add an attribute with name 'name' and value 'obj' to the module 'mod.
Expand Down

0 comments on commit 65ac273

Please sign in to comment.