Skip to content

Commit

Permalink
Merge pull request #23 from Mo-way/fix/windows-sigpipe-issue
Browse files Browse the repository at this point in the history
Fix #9 and #17 SIGPIPE import issue on windows
  • Loading branch information
chris-ritsen authored Sep 12, 2024
2 parents ff2db9b + 8da8ab6 commit 28d4117
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions netaudio/console/application.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from signal import signal, SIGPIPE, SIG_DFL
from cleo.application import Application
from netaudio import version

Expand All @@ -10,7 +9,12 @@
SubscriptionCommand,
)

signal(SIGPIPE, SIG_DFL)
# Fix Windows issue, See: https://stackoverflow.com/q/58718659/
try:
from signal import signal, SIGPIPE, SIG_DFL
signal(SIGPIPE, SIG_DFL)
except ImportError: # If SIGPIPE is not available (win32),
pass # we don't have to do anything to ignore it.


def main() -> int:
Expand Down

0 comments on commit 28d4117

Please sign in to comment.