Skip to content

Commit 4d1fb3d

Browse files
committed
boxes/run: Explicitly define type & remove type-ignores.
One of these are required by the upgrade of mypy to version 1.0.0, which flags an unnecessary type-ignore as an error. The other case is a second type-ignore that can be removed via explicitly typing.
1 parent ec19fd5 commit 4d1fb3d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

zulipterminal/cli/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ def main(options: Optional[List[str]] = None) -> None:
550550
pudb.post_mortem()
551551

552552
if hasattr(e, "extra_info"):
553-
print(in_color("red", f"\n{e.extra_info}"), file=sys.stderr) # type: ignore
553+
print(in_color("red", f"\n{e.extra_info}"), file=sys.stderr)
554554

555555
print(
556556
in_color(

zulipterminal/ui_tools/boxes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,7 @@ def top_search_bar(self) -> Any:
10961096
]
10971097
else:
10981098
self.model.controller.view.search_box.text_box.set_edit_text("")
1099+
text_to_fill: Union[str, Tuple[str, List[Tuple[str, str]]]]
10991100
if curr_narrow == []:
11001101
text_to_fill = "All messages"
11011102
elif len(curr_narrow) == 1 and curr_narrow[0][1] == "private":
@@ -1110,14 +1111,14 @@ def top_search_bar(self) -> Any:
11101111
bar_color = f"s{bar_color}"
11111112
if len(curr_narrow) == 2 and curr_narrow[1][0] == "topic":
11121113
text_to_fill = (
1113-
"bar", # type: ignore
1114+
"bar",
11141115
[
11151116
(bar_color, self.stream_name),
11161117
(bar_color, ": topic narrow"),
11171118
],
11181119
)
11191120
else:
1120-
text_to_fill = ("bar", [(bar_color, self.stream_name)]) # type: ignore
1121+
text_to_fill = ("bar", [(bar_color, self.stream_name)])
11211122
elif len(curr_narrow) == 1 and len(curr_narrow[0][1].split(",")) > 1:
11221123
text_to_fill = "Group private conversation"
11231124
else:

0 commit comments

Comments
 (0)