summaryrefslogtreecommitdiffstats
path: root/Tools/clinic
diff options
context:
space:
mode:
authorTal Einat <taleinat@gmail.com>2017-11-03 13:43:13 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-11-03 13:43:13 (GMT)
commitf8b3f6b178e48773cd7298141cbaf408c6917e41 (patch)
tree8d19fc8ac85315173c01f8f674abcc168d90459c /Tools/clinic
parent019c99f325287741d1e0eefeef2b75c8e00b884f (diff)
downloadcpython-f8b3f6b178e48773cd7298141cbaf408c6917e41.zip
cpython-f8b3f6b178e48773cd7298141cbaf408c6917e41.tar.gz
cpython-f8b3f6b178e48773cd7298141cbaf408c6917e41.tar.bz2
[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 4f57409a2f7bdf8fb559cddc7c6533ca2c471c67)
Diffstat (limited to 'Tools/clinic')
-rwxr-xr-xTools/clinic/clinic.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index 75ac673..f8663f0 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -928,8 +928,8 @@ class CLanguage(Language):
cpp_if = "#if " + conditional
cpp_endif = "#endif /* " + conditional + " */"
- if methoddef_define and f.name not in clinic.ifndef_symbols:
- clinic.ifndef_symbols.add(f.name)
+ if methoddef_define and f.full_name not in clinic.ifndef_symbols:
+ clinic.ifndef_symbols.add(f.full_name)
methoddef_ifndef = normalize_snippet("""
#ifndef {methoddef_name}
#define {methoddef_name}