Skip to content

Commit 3263180

Browse files
committed
only SIGPIPE if Linux
1 parent 3d61aff commit 3263180

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

netfoundry/ctl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
# importing this causes the 'config' subcommand to be available
3232
from jwt.exceptions import PyJWTError
33-
from platformdirs import user_cache_path
3433
from pygments import highlight
3534
from pygments.formatters import Terminal256Formatter
3635
from pygments.lexers import get_lexer_by_name, load_lexer_from_file
@@ -52,8 +51,9 @@
5251
from milc import cli, questions # this uses metadata set above
5352
from milc.subcommand import config # this creates the config subcommand
5453

55-
# this allows the app the terminate gracefully when piped to a truncating consumer like `head`
56-
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
54+
if platform.system() == 'Linux':
55+
# this allows the app the terminate gracefully when piped to a truncating consumer like `head`
56+
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
5757

5858

5959
class StoreDictKeyPair(argparse.Action):

0 commit comments

Comments
 (0)