Skip to content

Commit

Permalink
Address review comment
Browse files Browse the repository at this point in the history
Co-authored-by: Ilya Priven <ilya.konstantinov@gmail.com>
  • Loading branch information
atugushev and ikonst committed Aug 15, 2023
1 parent 846701d commit dceaac1
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions mypy/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,13 +1021,10 @@ def duplicate_argument_value(self, callee: CallableType, index: int, context: Co

def does_not_return_value(self, callee_type: Type | None, context: Context) -> None:
"""Report an error about use of an unusable type."""
name: str | None = None
callee_type = get_proper_type(callee_type)
if isinstance(callee_type, FunctionLike):
name = callable_name(callee_type)
message = "{} does not return a value (or returns None)".format(
"Function" if name is None else capitalize(name)
)
callee_name = callable_name(callee_type) if isinstance(callee_type, FunctionLike) else None
name = callee_name or "Function"
message = f"{name} does not return a value (or returns None)"
self.fail(message, context, code=codes.FUNC_RETURNS_VALUE)

def deleted_as_rvalue(self, typ: DeletedType, context: Context) -> None:
Expand Down

0 comments on commit dceaac1

Please sign in to comment.