summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorTal Einat <taleinat@gmail.com>2017-11-03 11:09:00 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2017-11-03 11:09:00 +0200
commit4f57409a2f7bdf8fb559cddc7c6533ca2c471c67 (patch)
treefe4ded27d3d8ade96a60a849ddce32c6facfbc6e /Tools
parent700d2e4755921d6c339ff20dacecde1aea64de34 (diff)
downloadcpython-git-4f57409a2f7bdf8fb559cddc7c6533ca2c471c67.tar.gz
bpo-31926: fix missing *_METHODDEF statements by argument clinic (#4230)
When a single .c file contains several functions and/or methods with the same name, a safety _METHODDEF #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.
Diffstat (limited to 'Tools')
-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 91d8440e14..4cdfebb510 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -957,8 +957,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}