8000 gh-91583: AC: Fix regression for functions with defining_class by serhiy-storchaka · Pull Request #91739 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-91583: AC: Fix regression for functions with defining_class #91739

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 5 commits into from
Apr 30, 2022
Merged
Show file tree
Hide file tree
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
Prev Previous commit
Next Next commit
Fix functions with defining_class and without parameters
  • Loading branch information
serhiy-storchaka committed Apr 20, 2022
commit 8cd709a16d67f21220070797a1ed97ab0d135708
4 changes: 2 additions & 2 deletions Modules/clinic/posixmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,12 +789,14 @@ def parser_body(prototype, *fields, declarations=''):
flags = "METH_METHOD|METH_FASTCALL|METH_KEYWORDS"

parser_prototype = parser_prototype_def_class
return_error = ('return NULL;' if default_return_converter
else 'goto exit;')
parser_code = [normalize_snippet("""
if (nargs) {{
PyErr_SetString(PyExc_TypeError, "{name}() takes no arguments");
return NULL;
%s
}}
""", indent=4)]
""" % return_error, indent=4)]

if default_return_converter:
parser_definition = '\n'.join([
Expand Down
0