Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 15 additions & 0 deletions Lib/test/test_clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,21 @@ class C "void *" ""
err = "'__new__' must be a class method"
self.expect_failure(block, err, lineno=7)

def test_alias_new_error_message(self):
block = dedent("""
/*[clinic input]
output everything block
class C "void *" ""
@classmethod
C.__new__
a: object = None
*
b as a: object = None
[clinic start generated code]*/
""")
generated = self.clinic.parse(block)
self.assertIn('"argument for C() given by "', generated)

def test_no_c_basename_cloned(self):
block = """
/*[clinic input]
Expand Down
2 changes: 1 addition & 1 deletion Tools/clinic/libclinic/parse_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ def render_alias(self, p: Parameter, argname_fmt: str,
libclinic.normalize_snippet(f"""
if ({argname_fmt % i}) {{{{
PyErr_Format(PyExc_TypeError,
"argument for {self.func.name}() given by "
"argument for {self.func.displayname}() given by "
"name ('{p.name}') and {other}"{arg});
goto exit;
}}}}
Expand Down
Loading