Skip to content

Commit

Permalink
fix pypy error
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenZcience committed Mar 21, 2024
1 parent 2c10699 commit 25a2bc3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cat_win/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ def _show_help(shell: bool = False) -> None:
help_message += 'while numerating and showing the end of lines\n'
help_message += f"\t{'catw f trunc=a:b:c': <25}"
help_message += "Output f's content starting at line a, ending at line b, stepping c\n"
t_height = max(os.get_terminal_size()[1], 2)
try:
t_height = max(os.get_terminal_size()[1], 2)
except OSError: # PyPy "Inappropriate ioctl for device"
t_height = 30
for chunk_s, line in enumerate(help_message.splitlines()):
print(line)
if chunk_s % (t_height-1) == t_height-2:
Expand Down

0 comments on commit 25a2bc3

Please sign in to comment.