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
9 changes: 8 additions & 1 deletion mypy/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -3015,7 +3015,14 @@ def [T <: int] f(self, x: int, y: T) -> None
if s:
s = ", " + s
s = first_arg + s
s = f"{tp.name.split()[0]}({s})" # skip "of Class" part
if (
isinstance(definition, FuncDef)
and hasattr(definition, "name")
and definition.name == "__init__"
):
s = f"{definition.name}({s})"
else:
s = f"{tp.name.split()[0]}({s})" # skip "of Class" part
else:
s = f"({s})"

Expand Down
2 changes: 1 addition & 1 deletion mypy/test/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
if provided_prefix:
PREFIX = provided_prefix
else:
this_file_dir = os.path.dirname(os.path.realpath(__file__))
this_file_dir = os.path.dirname(os.path.abspath(__file__))
PREFIX = os.path.dirname(os.path.dirname(this_file_dir))

# Location of test data files such as test case descriptions.
Expand Down
4 changes: 2 additions & 2 deletions test-data/unit/check-serialize.test
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ class A:
[out2]
tmp/a.py:2: error: No overload variant of "A" matches argument type "object"
tmp/a.py:2: note: Possible overload variants:
tmp/a.py:2: note: def A(self, x: int) -> A
tmp/a.py:2: note: def A(self, x: str) -> A
tmp/a.py:2: note: def __init__(self, x: int) -> A
tmp/a.py:2: note: def __init__(self, x: str) -> A
tmp/a.py:7: error: No overload variant of "__init__" of "A" matches argument type "object"
tmp/a.py:7: note: Possible overload variants:
tmp/a.py:7: note: def __init__(self, x: int) -> None
Expand Down