Skip to content

Commit 2954f83

Browse files
- Issue python#27332: Fixed the type of the first argument of module-level functions
generated by Argument Clinic. Patch by Petr Viktorin.
2 parents 50600a7 + 1a2b24f commit 2954f83

71 files changed

Lines changed: 1818 additions & 1839 deletions

Some content is hidden

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

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ Build
146146
Tools/Demos
147147
-----------
148148

149+
- Issue #27332: Fixed the type of the first argument of module-level functions
150+
generated by Argument Clinic. Patch by Petr Viktorin.
151+
149152
- Issue #27418: Fixed Tools/importbench/importbench.py.
150153

151154

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};
@@ -157,4 +157,4 @@ _io_open(PyModuleDef *module, PyObject *args, PyObject *kwargs)
157157
exit:
158158
return return_value;
159159
}
160-
/*[clinic end generated code: output=079f597e71e9f0c6 input=a9049054013a1b77]*/
160+
/*[clinic end generated code: output=ae2facf262cf464e input=a9049054013a1b77]*/

Modules/_lzmamodule.c

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

13381338
static PyObject *
1339-
_lzma_is_check_supported_impl(PyModuleDef *module, int check_id)
1340-
/*[clinic end generated code: output=bb828e90e00ad96e input=5518297b97b2318f]*/
1339+
_lzma_is_check_supported_impl(PyObject *module, int check_id)
1340+
/*[clinic end generated code: output=e4f14ba3ce2ad0a5 input=5518297b97b2318f]*/
13411341
{
13421342
return PyBool_FromLong(lzma_check_is_supported(check_id));
13431343
}
@@ -1354,8 +1354,8 @@ The result does not include the filter ID itself, only the options.
13541354
[clinic start generated code]*/
13551355

13561356
static PyObject *
1357-
_lzma__encode_filter_properties_impl(PyModuleDef *module, lzma_filter filter)
1358-
/*[clinic end generated code: output=b5fe690acd6b61d1 input=d4c64f1b557c77d4]*/
1357+
_lzma__encode_filter_properties_impl(PyObject *module, lzma_filter filter)
1358+
/*[clinic end generated code: output=5c93c8e14e7be5a8 input=d4c64f1b557c77d4]*/
13591359
{
13601360
lzma_ret lzret;
13611361
uint32_t encoded_size;
@@ -1394,9 +1394,9 @@ The result does not include the filter ID itself, only the options.
13941394
[clinic start generated code]*/
13951395

13961396
static PyObject *
1397-
_lzma__decode_filter_properties_impl(PyModuleDef *module, lzma_vli filter_id,
1397+
_lzma__decode_filter_properties_impl(PyObject *module, lzma_vli filter_id,
13981398
Py_buffer *encoded_props)
1399-
/*[clinic end generated code: output=af248f570746668b input=246410800782160c]*/
1399+
/*[clinic end generated code: output=714fd2ef565d5c60 input=246410800782160c]*/
14001400
{
14011401
lzma_filter filter;
14021402
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
@@ -7051,9 +7051,9 @@ to map the new Python 3 names to the old module names used in Python
70517051
[clinic start generated code]*/
70527052

70537053
static PyObject *
7054-
_pickle_dump_impl(PyModuleDef *module, PyObject *obj, PyObject *file,
7054+
_pickle_dump_impl(PyObject *module, PyObject *obj, PyObject *file,
70557055
PyObject *protocol, int fix_imports)
7056-
/*[clinic end generated code: output=0de7dff89c406816 input=830f8a64cef6f042]*/
7056+
/*[clinic end generated code: output=a4774d5fde7d34de input=830f8a64cef6f042]*/
70577057
{
70587058
PicklerObject *pickler = _Pickler_New();
70597059

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

71077107
static PyObject *
7108-
_pickle_dumps_impl(PyModuleDef *module, PyObject *obj, PyObject *protocol,
7108+
_pickle_dumps_impl(PyObject *module, PyObject *obj, PyObject *protocol,
71097109
int fix_imports)
7110-
/*[clinic end generated code: output=daa380db56fe07b9 input=293dbeda181580b7]*/
7110+
/*[clinic end generated code: output=d75d5cda456fd261 input=293dbeda181580b7]*/
71117111
{
71127112
PyObject *result;
71137113
PicklerObject *pickler = _Pickler_New();
@@ -7166,9 +7166,9 @@ string instances as bytes objects.
71667166
[clinic start generated code]*/
71677167

71687168
static PyObject *
7169-
_pickle_load_impl(PyModuleDef *module, PyObject *file, int fix_imports,
7169+
_pickle_load_impl(PyObject *module, PyObject *file, int fix_imports,
71707170
const char *encoding, const char *errors)
7171-
/*[clinic end generated code: output=798f1c57cb2b4eb1 input=01b44dd3fc07afa7]*/
7171+
/*[clinic end generated code: output=69e298160285199e input=01b44dd3fc07afa7]*/
71727172
{
71737173
PyObject *result;
71747174
UnpicklerObject *unpickler = _Unpickler_New();
@@ -7220,9 +7220,9 @@ string instances as bytes objects.
72207220
[clinic start generated code]*/
72217221

72227222
static PyObject *
7223-
_pickle_loads_impl(PyModuleDef *module, PyObject *data, int fix_imports,
7223+
_pickle_loads_impl(PyObject *module, PyObject *data, int fix_imports,
72247224
const char *encoding, const char *errors)
7225-
/*[clinic end generated code: output=61e9cdb01e36a736 input=70605948a719feb9]*/
7225+
/*[clinic end generated code: output=1e7cb2343f2c440f input=70605948a719feb9]*/
72267226
{
72277227
PyObject *result;
72287228
UnpicklerObject *unpickler = _Unpickler_New();

0 commit comments

Comments
 (0)