From 81e36cecb325e1936e2146a8c5d0a746dd82d960 Mon Sep 17 00:00:00 2001 From: Hizuru <106918920+Hizuru3@users.noreply.github.com> Date: Sun, 24 Mar 2024 17:05:01 +0900 Subject: [PATCH] Make the CLI compatible with Windows OS (#43) * Make compatible with Windows OS --- cutlet/cli.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cutlet/cli.py b/cutlet/cli.py index 0a144eb..cb57f26 100644 --- a/cutlet/cli.py +++ b/cutlet/cli.py @@ -2,12 +2,15 @@ import fileinput import sys -# Don't print an error on SIGPIPE -from signal import signal, SIGPIPE, SIG_DFL +if sys.platform != "win32": + # Don't print an error on SIGPIPE + from signal import signal, SIGPIPE, SIG_DFL + + signal(SIGPIPE, SIG_DFL) + def main(): - signal(SIGPIPE, SIG_DFL) - system = sys.argv[1] if len(sys.argv) > 1 else 'hepburn' + system = sys.argv[1] if len(sys.argv) > 1 else "hepburn" katsu = Cutlet(system)