[3.6] bpo-31926: fix missing *_METHODDEF statements by argument clini… · python/cpython@f8b3f6b · GitHub
Skip to content

Commit f8b3f6b

Browse files
taleinatvstinner
authored andcommitted
[3.6] bpo-31926: fix missing *_METHODDEF statements by argument clinic (GH-4230) (#4253)
When a single .c file contains several functions and/or methods with the same name, a safety _METHODDEF GH-define statement is generated only for one of them. This fixes the bug by using the full name of the function to avoid duplicates rather than just the name.. (cherry picked from commit 4f57409)
1 parent 019c99f commit f8b3f6b

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

Lines changed: 2 additions & 0 deletions

Modules/clinic/zlibmodule.c.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,4 +467,8 @@ zlib_crc32(PyObject *module, PyObject *args)
467467
#ifndef ZLIB_COMPRESS_COPY_METHODDEF
468468
#define ZLIB_COMPRESS_COPY_METHODDEF
469469
#endif /* !defined(ZLIB_COMPRESS_COPY_METHODDEF) */
470-
/*[clinic end generated code: output=3a4e2bfe750423a3 input=a9049054013a1b77]*/
470+
471+
#ifndef ZLIB_DECOMPRESS_COPY_METHODDEF
472+
#define ZLIB_DECOMPRESS_COPY_METHODDEF
473+
#endif /* !defined(ZLIB_DECOMPRESS_COPY_METHODDEF) */
474+
/*[clinic end generated code: output=497dad1132c962e2 input=a9049054013a1b77]*/

Modules/zlibmodule.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,19 +1149,15 @@ static PyMethodDef comp_methods[] =
11491149
{
11501150
ZLIB_COMPRESS_COMPRESS_METHODDEF
11511151
ZLIB_COMPRESS_FLUSH_METHODDEF
1152-
#ifdef HAVE_ZLIB_COPY
11531152
ZLIB_COMPRESS_COPY_METHODDEF
1154-
#endif
11551153
{NULL, NULL}
11561154
};
11571155

11581156
static PyMethodDef Decomp_methods[] =
11591157
{
11601158
ZLIB_DECOMPRESS_DECOMPRESS_METHODDEF
11611159
ZLIB_DECOMPRESS_FLUSH_METHODDEF
1162-
#ifdef HAVE_ZLIB_COPY
11631160
ZLIB_DECOMPRESS_COPY_METHODDEF
1164-
#endif
11651161
{NULL, NULL}
11661162
};
11671163

Tools/clinic/clinic.py

Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)