Skip to content

Commit 3e1fad6

Browse files
committed
Rename _PyArg_ParseStack to _PyArg_ParseStackAndKeywords
Issue #29286.
1 parent c0083fc commit 3e1fad6

38 files changed

Lines changed: 177 additions & 177 deletions

Include/abstract.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ PyAPI_FUNC(PyObject*) _PyStack_AsTupleSlice(
171171
172172
kwnames must only contains str strings, no subclass, and all keys must be
173173
unique. kwnames is not checked, usually these checks are done before or
174-
later calling _PyStack_AsDict(). For example, _PyArg_ParseStack() raises an
174+
later calling _PyStack_AsDict(). For example, _PyArg_ParseStackAndKeywords() raises an
175175
error if a key is not a string. */
176176
PyAPI_FUNC(PyObject *) _PyStack_AsDict(
177177
PyObject **values,
@@ -185,7 +185,7 @@ PyAPI_FUNC(PyObject *) _PyStack_AsDict(
185185
The stack uses borrowed references.
186186
187187
The type of keyword keys is not checked, these checks should be done
188-
later (ex: _PyArg_ParseStack). */
188+
later (ex: _PyArg_ParseStackAndKeywords). */
189189
PyAPI_FUNC(PyObject **) _PyStack_UnpackDict(
190190
PyObject **args,
191191
Py_ssize_t nargs,

Include/modsupport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ typedef struct _PyArg_Parser {
7979
} _PyArg_Parser;
8080
#ifdef PY_SSIZE_T_CLEAN
8181
#define _PyArg_ParseTupleAndKeywordsFast _PyArg_ParseTupleAndKeywordsFast_SizeT
82-
#define _PyArg_ParseStack _PyArg_ParseStack_SizeT
82+
#define _PyArg_ParseStackAndKeywords _PyArg_ParseStackAndKeywords_SizeT
8383
#define _PyArg_VaParseTupleAndKeywordsFast _PyArg_VaParseTupleAndKeywordsFast_SizeT
8484
#endif
8585
PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *,
8686
struct _PyArg_Parser *, ...);
87-
PyAPI_FUNC(int) _PyArg_ParseStack(PyObject **args, Py_ssize_t nargs, PyObject *kwnames,
87+
PyAPI_FUNC(int) _PyArg_ParseStackAndKeywords(PyObject **args, Py_ssize_t nargs, PyObject *kwnames,
8888
struct _PyArg_Parser *, ...);
8989
PyAPI_FUNC(int) _PyArg_VaParseTupleAndKeywordsFast(PyObject *, PyObject *,
9090
struct _PyArg_Parser *, va_list);

Modules/_io/clinic/_iomodule.c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ _io_open(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
149149
int closefd = 1;
150150
PyObject *opener = Py_None;
151151

152-
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
152+
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
153153
&file, &mode, &buffering, &encoding, &errors, &newline, &closefd, &opener)) {
154154
goto exit;
155155
}

Modules/_io/clinic/textio.c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ _io_IncrementalNewlineDecoder_decode(nldecoder_object *self, PyObject **args, Py
6161
PyObject *input;
6262
int final = 0;
6363

64-
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
64+
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
6565
&input, &final)) {
6666
goto exit;
6767
}

Modules/_sha3/clinic/sha3module.c.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ _sha3_shake_128_digest(SHA3object *self, PyObject **args, Py_ssize_t nargs, PyOb
112112
static _PyArg_Parser _parser = {"k:digest", _keywords, 0};
113113
unsigned long length;
114114

115-
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
115+
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
116116
&length)) {
117117
goto exit;
118118
}
@@ -142,7 +142,7 @@ _sha3_shake_128_hexdigest(SHA3object *self, PyObject **args, Py_ssize_t nargs, P
142142
static _PyArg_Parser _parser = {"k:hexdigest", _keywords, 0};
143143
unsigned long length;
144144

145-
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
145+
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
146146
&length)) {
147147
goto exit;
148148
}

Modules/cjkcodecs/clinic/multibytecodec.c.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ _multibytecodec_MultibyteCodec_encode(MultibyteCodecObject *self, PyObject **arg
3030
PyObject *input;
3131
const char *errors = NULL;
3232

33-
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
33+
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
3434
&input, &errors)) {
3535
goto exit;
3636
}
@@ -68,7 +68,7 @@ _multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject **arg
6868
Py_buffer input = {NULL, NULL};
6969
const char *errors = NULL;
7070

71-
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
71+
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
7272
&input, &errors)) {
7373
goto exit;
7474
}
@@ -105,7 +105,7 @@ _multibytecodec_MultibyteIncrementalEncoder_encode(MultibyteIncrementalEncoderOb
105105
PyObject *input;
106106
int final = 0;
107107

108-
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
108+
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
109109
&input, &final)) {
110110
goto exit;
111111
}
@@ -154,7 +154,7 @@ _multibytecodec_MultibyteIncrementalDecoder_decode(MultibyteIncrementalDecoderOb
154154
Py_buffer input = {NULL, NULL};
155155
int final = 0;
156156

157-
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
157+
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
158158
&input, &final)) {
159159
goto exit;
160160
}

Modules/clinic/_asynciomodule.c.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ _asyncio_Task_current_task(PyTypeObject *type, PyObject **args, Py_ssize_t nargs
280280
static _PyArg_Parser _parser = {"|O:current_task", _keywords, 0};
281281
PyObject *loop = NULL;
282282

283-
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
283+
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
284284
&loop)) {
285285
goto exit;
286286
}
@@ -312,7 +312,7 @@ _asyncio_Task_all_tasks(PyTypeObject *type, PyObject **args, Py_ssize_t nargs, P
312312
static _PyArg_Parser _parser = {"|O:all_tasks", _keywords, 0};
313313
PyObject *loop = NULL;
314314

315-
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
315+
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
316316
&loop)) {
317317
goto exit;
318318
}
@@ -412,7 +412,7 @@ _asyncio_Task_get_stack(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyObje
412412
static _PyArg_Parser _parser = {"|$O:get_stack", _keywords, 0};
413413
PyObject *limit = Py_None;
414414

415-
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
415+
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
416416
&limit)) {
417417
goto exit;
418418
}
@@ -450,7 +450,7 @@ _asyncio_Task_print_stack(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyOb
450450
PyObject *limit = Py_None;
451451
PyObject *file = Py_None;
452452

453-
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
453+
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
454454
&limit, &file)) {
455455
goto exit;
456456
}
@@ -479,7 +479,7 @@ _asyncio_Task__step(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyObject *
479479
static _PyArg_Parser _parser = {"|O:_step", _keywords, 0};
480480
PyObject *exc = NULL;
481481

482-
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
482+
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
483483
&exc)) {
484484
goto exit;
485485
}
@@ -508,7 +508,7 @@ _asyncio_Task__wakeup(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyObject
508508
static _PyArg_Parser _parser = {"O:_wakeup", _keywords, 0};
509509
PyObject *fut;
510510

511-
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
511+
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
512512
&fut)) {
513513
goto exit;
514514
}

Modules/clinic/_bz2module.c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ _bz2_BZ2Decompressor_decompress(BZ2Decompressor *self, PyObject **args, Py_ssize
130130
Py_buffer data = {NULL, NULL};
131131
Py_ssize_t max_length = -1;
132132

133-
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
133+
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
134134
&data, &max_length)) {
135135
goto exit;
136136
}

Modules/clinic/_codecsmodule.c.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ _codecs_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw
7171
const char *encoding = NULL;
7272
const char *errors = NULL;
7373

74-
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
74+
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
7575
&obj, &encoding, &errors)) {
7676
goto exit;
7777
}
@@ -110,7 +110,7 @@ _codecs_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw
110110
const char *encoding = NULL;
111111
const char *errors = NULL;
112112

113-
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
113+
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
114114
&obj, &encoding, &errors)) {
115115
goto exit;
116116
}

Modules/clinic/_datetimemodule.c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ datetime_datetime_now(PyTypeObject *type, PyObject **args, Py_ssize_t nargs, PyO
2727
static _PyArg_Parser _parser = {"|O:now", _keywords, 0};
2828
PyObject *tz = Py_None;
2929

30-
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
30+
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
3131
&tz)) {
3232
goto exit;
3333
}

0 commit comments

Comments
 (0)