From 7885df518c231e0e8a1aa358bbcea049ef677de0 Mon Sep 17 00:00:00 2001 From: Andy Wood Date: Sun, 16 Aug 2026 04:29:21 -0700 Subject: [PATCH] use the higher-level shutil for terminal dimensions --- src/frogtips/frogsay.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/frogtips/frogsay.py b/src/frogtips/frogsay.py index 0e61d8f..ca42994 100644 --- a/src/frogtips/frogsay.py +++ b/src/frogtips/frogsay.py @@ -1,6 +1,6 @@ from frogtips import constants import random -import os +import shutil def say(text_to_say, tip_id=0): @@ -23,10 +23,7 @@ def say(text_to_say, tip_id=0): frog_image_width = get_max_width(frog_image.split("\n")) # Determine the width of the terminal - try: - columns, rows = os.get_terminal_size(0) - except OSError: - columns, rows = os.get_terminal_size(1) + columns, rows = shutil.get_terminal_size() # Determine the maximum width of the output text. # The number 4 is determined by taking one character for each side of the