Skip to content

Commit

Permalink
Fix issues previously type ignored.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasBackx committed Nov 9, 2024
1 parent 3b06e0b commit fde47b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/click/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def writable(self) -> bool:
if x is not None:
return t.cast(bool, x())
try:
self._stream.write("") # type: ignore
self._stream.write(b"")
except Exception:
try:
self._stream.write(b"")
Expand Down
4 changes: 2 additions & 2 deletions src/click/_termui_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ def render_progress(self) -> None:
self.width = 0
clutter_length = term_len(self.format_progress_line())
new_width = max(0, shutil.get_terminal_size().columns - clutter_length)
if new_width < old_width:
if new_width < old_width and self.max_width is not None:
buf.append(BEFORE_BAR)
buf.append(" " * self.max_width) # type: ignore
buf.append(" " * self.max_width)
self.max_width = new_width
self.width = new_width

Expand Down

0 comments on commit fde47b4

Please sign in to comment.