From e963da457a8616ba547fd8a3bd415d4fa0720134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sadam=C2=B7Sadik?= <1903249375@qq.com> Date: Sat, 10 Dec 2022 19:15:04 +0800 Subject: [PATCH] Fixed the BUG(OSError: [Errno 25] Inappropriate ioctl for device) that has been occurred when use this script on background via nohup. --- Ingram/utils/logo.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Ingram/utils/logo.py b/Ingram/utils/logo.py index f17ce3f..bbd10f7 100644 --- a/Ingram/utils/logo.py +++ b/Ingram/utils/logo.py @@ -326,7 +326,11 @@ def generate_logo() -> list: font = random.choice(ingram_fonts).split('\n') font_width = max([len(i) for i in font]) font_height = len(font) - if font_width + icon_width + 2 < os.get_terminal_size()[0]: + try: + if font_width + icon_width + 2 < os.get_terminal_size()[0]: + found = True + break + except: found = True break if not found: