10000 bpo-31926: fix missing *_METHODDEF statements by argument clinic by taleinat · Pull Request #4230 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-31926: fix missing *_METHODDEF statements by argument clinic #4230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
bpo-31926: fix missing *_METHODDEF statements by argument clinic
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.
  • Loading branch information
taleinat committed Nov 2, 2017
commit d2aeb8ff07e4c7d25ecba5872336d9ade85050d1
4 changes: 2 additions & 2 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,8 +957,8 @@ def insert_keywords(s):
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}
Expand Down
0