Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 672920742
  • Loading branch information
frigus02 authored and copybara-github committed Sep 10, 2024
1 parent 74bc20c commit 6f7a3aa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pytype/annotation_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def sub_annotations_for_parameterized_class(
formal_type_parameters = cls.get_formal_type_parameters()

def get_type_parameter_subst(
annotation: abstract.TypeParameter,
annotation: abstract.BaseValue,
) -> Optional[abstract.BaseValue]:
# Normally the type parameter module is set correctly at this point.
# Except for the case when a method that references this type parameter
Expand Down
16 changes: 9 additions & 7 deletions pytype/errors/error_printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,16 @@ def _print_typed_dict_error(self, error) -> str:
return ret

def print_error_details(
self, error_details: error_types.MatcherErrorDetails
self, details: error_types.MatcherErrorDetails
) -> List[str]:
printers = [
(error_details.protocol, self._print_protocol_error),
(error_details.noniterable_str, self._print_noniterable_str_error),
(error_details.typed_dict, self._print_typed_dict_error),
]
return ["\n" + printer(err) if err else "" for err, printer in printers]
errors: List[str] = []
if details.protocol:
errors.append(self._print_protocol_error(details.protocol))
if details.noniterable_str:
errors.append(self._print_noniterable_str_error(details.noniterable_str))
if details.typed_dict:
errors.append(self._print_typed_dict_error(details.typed_dict))
return ["\n" + err for err in errors]

def prepare_errorlog_details(self, bad: List[matcher.BadMatch]) -> List[str]:
"""Prepare printable annotation matching errors."""
Expand Down

0 comments on commit 6f7a3aa

Please sign in to comment.