Skip to content

Commit 1a2b24f

Browse files
Issue #27332: Fixed the type of the first argument of module-level functions
generated by Argument Clinic. Patch by Petr Viktorin.
1 parent b8a2f51 commit 1a2b24f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1814
-1835
lines changed

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ C API
8080
Tools/Demos
8181
-----------
8282

83+
- Issue #27332: Fixed the type of the first argument of module-level functions
84+
generated by Argument Clinic. Patch by Petr Viktorin.
85+
8386
- Issue #27418: Fixed Tools/importbench/importbench.py.
8487

8588

Modules/_codecsmodule.c

Lines changed: 91 additions & 92 deletions
Large diffs are not rendered by default.

Modules/_cryptmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ results for a given *word*.
3131
[clinic start generated code]*/
3232

3333
static PyObject *
34-
crypt_crypt_impl(PyModuleDef *module, const char *word, const char *salt)
35-
/*[clinic end generated code: output=995ad1e854d83069 input=0e8edec9c364352b]*/
34+
crypt_crypt_impl(PyObject *module, const char *word, const char *salt)
35+
/*[clinic end generated code: output=0512284a03d2803c input=0e8edec9c364352b]*/
3636
{
3737
/* On some platforms (AtheOS) crypt returns NULL for an invalid
3838
salt. Return None in that case. XXX Maybe raise an exception? */

Modules/_dbmmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,9 @@ Return a database object.
430430
[clinic start generated code]*/
431431

432432
static PyObject *
433-
dbmopen_impl(PyModuleDef *module, const char *filename, const char *flags,
433+
dbmopen_impl(PyObject *module, const char *filename, const char *flags,
434434
int mode)
435-
/*[clinic end generated code: output=e8d4b36f25c733fd input=226334bade5764e6]*/
435+
/*[clinic end generated code: output=5fade8cf16e0755f input=226334bade5764e6]*/
436436
{
437437
int iflags;
438438

Modules/_gdbmmodule.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,8 @@ when the database has to be created. It defaults to octal 0o666.
562562
[clinic start generated code]*/
563563

564564
static PyObject *
565-
dbmopen_impl(PyModuleDef *module, const char *name, const char *flags,
566-
int mode)
567-
/*[clinic end generated code: output=365b31415c03ccd4 input=55563cd60e51984a]*/
565+
dbmopen_impl(PyObject *module, const char *name, const char *flags, int mode)
566+
/*[clinic end generated code: output=31aa1bafdf5da688 input=55563cd60e51984a]*/
568567
{
569568
int iflags;
570569

Modules/_io/_iomodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,10 @@ opened in a binary mode.
227227
[clinic start generated code]*/
228228

229229
static PyObject *
230-
_io_open_impl(PyModuleDef *module, PyObject *file, const char *mode,
230+
_io_open_impl(PyObject *module, PyObject *file, const char *mode,
231231
int buffering, const char *encoding, const char *errors,
232232
const char *newline, int closefd, PyObject *opener)
233-
/*[clinic end generated code: output=7615d0d746eb14d2 input=f4e1ca75223987bc]*/
233+
/*[clinic end generated code: output=aefafc4ce2b46dc0 input=f4e1ca75223987bc]*/
234234
{
235235
unsigned i;
236236

Modules/_io/clinic/_iomodule.c.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ PyDoc_STRVAR(_io_open__doc__,
130130
{"open", (PyCFunction)_io_open, METH_VARARGS|METH_KEYWORDS, _io_open__doc__},
131131

132132
static PyObject *
133-
_io_open_impl(PyModuleDef *module, PyObject *file, const char *mode,
133+
_io_open_impl(PyObject *module, PyObject *file, const char *mode,
134134
int buffering, const char *encoding, const char *errors,
135135
const char *newline, int closefd, PyObject *opener);
136136

137137
static PyObject *
138-
_io_open(PyModuleDef *module, PyObject *args, PyObject *kwargs)
138+
_io_open(PyObject *module, PyObject *args, PyObject *kwargs)
139139
{
140140
PyObject *return_value = NULL;
141141
static char *_keywords[] = {"file", "mode", "buffering", "encoding", "errors", "newline", "closefd", "opener", NULL};
@@ -156,4 +156,4 @@ _io_open(PyModuleDef *module, PyObject *args, PyObject *kwargs)
156156
exit:
157157
return return_value;
158158
}
159-
/*[clinic end generated code: output=97cdc09bf68a8064 input=a9049054013a1b77]*/
159+
/*[clinic end generated code: output=bc2c003cb7daeafe input=a9049054013a1b77]*/

Modules/_lzmamodule.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,8 +1342,8 @@ Always returns True for CHECK_NONE and CHECK_CRC32.
13421342
[clinic start generated code]*/
13431343

13441344
static PyObject *
1345-
_lzma_is_check_supported_impl(PyModuleDef *module, int check_id)
1346-
/*[clinic end generated code: output=bb828e90e00ad96e input=5518297b97b2318f]*/
1345+
_lzma_is_check_supported_impl(PyObject *module, int check_id)
1346+
/*[clinic end generated code: output=e4f14ba3ce2ad0a5 input=5518297b97b2318f]*/
13471347
{
13481348
return PyBool_FromLong(lzma_check_is_supported(check_id));
13491349
}
@@ -1360,8 +1360,8 @@ The result does not include the filter ID itself, only the options.
13601360
[clinic start generated code]*/
13611361

13621362
static PyObject *
1363-
_lzma__encode_filter_properties_impl(PyModuleDef *module, lzma_filter filter)
1364-
/*[clinic end generated code: output=b5fe690acd6b61d1 input=d4c64f1b557c77d4]*/
1363+
_lzma__encode_filter_properties_impl(PyObject *module, lzma_filter filter)
1364+
/*[clinic end generated code: output=5c93c8e14e7be5a8 input=d4c64f1b557c77d4]*/
13651365
{
13661366
lzma_ret lzret;
13671367
uint32_t encoded_size;
@@ -1400,9 +1400,9 @@ The result does not include the filter ID itself, only the options.
14001400
[clinic start generated code]*/
14011401

14021402
static PyObject *
1403-
_lzma__decode_filter_properties_impl(PyModuleDef *module, lzma_vli filter_id,
1403+
_lzma__decode_filter_properties_impl(PyObject *module, lzma_vli filter_id,
14041404
Py_buffer *encoded_props)
1405-
/*[clinic end generated code: output=af248f570746668b input=246410800782160c]*/
1405+
/*[clinic end generated code: output=714fd2ef565d5c60 input=246410800782160c]*/
14061406
{
14071407
lzma_filter filter;
14081408
lzma_ret lzret;

Modules/_opcode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Compute the stack effect of the opcode.
2020
[clinic start generated code]*/
2121

2222
static int
23-
_opcode_stack_effect_impl(PyModuleDef *module, int opcode, PyObject *oparg)
24-
/*[clinic end generated code: output=1fcafd5596c6b050 input=2d0a9ee53c0418f5]*/
23+
_opcode_stack_effect_impl(PyObject *module, int opcode, PyObject *oparg)
24+
/*[clinic end generated code: output=ad39467fa3ad22ce input=2d0a9ee53c0418f5]*/
2525
{
2626
int effect;
2727
int oparg_int = 0;

Modules/_pickle.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6961,9 +6961,9 @@ to map the new Python 3 names to the old module names used in Python
69616961
[clinic start generated code]*/
69626962

69636963
static PyObject *
6964-
_pickle_dump_impl(PyModuleDef *module, PyObject *obj, PyObject *file,
6964+
_pickle_dump_impl(PyObject *module, PyObject *obj, PyObject *file,
69656965
PyObject *protocol, int fix_imports)
6966-
/*[clinic end generated code: output=0de7dff89c406816 input=830f8a64cef6f042]*/
6966+
/*[clinic end generated code: output=a4774d5fde7d34de input=830f8a64cef6f042]*/
69676967
{
69686968
PicklerObject *pickler = _Pickler_New();
69696969

@@ -7015,9 +7015,9 @@ Python 2, so that the pickle data stream is readable with Python 2.
70157015
[clinic start generated code]*/
70167016

70177017
static PyObject *
7018-
_pickle_dumps_impl(PyModuleDef *module, PyObject *obj, PyObject *protocol,
7018+
_pickle_dumps_impl(PyObject *module, PyObject *obj, PyObject *protocol,
70197019
int fix_imports)
7020-
/*[clinic end generated code: output=daa380db56fe07b9 input=293dbeda181580b7]*/
7020+
/*[clinic end generated code: output=d75d5cda456fd261 input=293dbeda181580b7]*/
70217021
{
70227022
PyObject *result;
70237023
PicklerObject *pickler = _Pickler_New();
@@ -7076,9 +7076,9 @@ string instances as bytes objects.
70767076
[clinic start generated code]*/
70777077

70787078
static PyObject *
7079-
_pickle_load_impl(PyModuleDef *module, PyObject *file, int fix_imports,
7079+
_pickle_load_impl(PyObject *module, PyObject *file, int fix_imports,
70807080
const char *encoding, const char *errors)
7081-
/*[clinic end generated code: output=798f1c57cb2b4eb1 input=01b44dd3fc07afa7]*/
7081+
/*[clinic end generated code: output=69e298160285199e input=01b44dd3fc07afa7]*/
70827082
{
70837083
PyObject *result;
70847084
UnpicklerObject *unpickler = _Unpickler_New();
@@ -7130,9 +7130,9 @@ string instances as bytes objects.
71307130
[clinic start generated code]*/
71317131

71327132
static PyObject *
7133-
_pickle_loads_impl(PyModuleDef *module, PyObject *data, int fix_imports,
7133+
_pickle_loads_impl(PyObject *module, PyObject *data, int fix_imports,
71347134
const char *encoding, const char *errors)
7135-
/*[clinic end generated code: output=61e9cdb01e36a736 input=70605948a719feb9]*/
7135+
/*[clinic end generated code: output=1e7cb2343f2c440f input=70605948a719feb9]*/
71367136
{
71377137
PyObject *result;
71387138
UnpicklerObject *unpickler = _Unpickler_New();

0 commit comments

Comments
 (0)