Skip to content

Commit

Permalink
fix: Do not use add_signal_handler on Windows (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-janicas authored Jun 6, 2024
1 parent 34be689 commit c5dc08d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions meltano/edk/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import signal
import subprocess
import sys
import typing as t

import structlog
Expand Down Expand Up @@ -135,10 +136,13 @@ async def _exec(
)

loop = asyncio.get_event_loop()
loop.add_signal_handler(
signal.SIGINT,
lambda s=signal.SIGINT: p.send_signal(s), # type: ignore[misc]
)
# Windows does not support add_signal_handler
# https://docs.python.org/3/library/asyncio-platforms.html
if sys.platform != "win32":
loop.add_signal_handler(
signal.SIGINT,
lambda s=signal.SIGINT: p.send_signal(s), # type: ignore[misc]
)

streams: list[asyncio.streams.StreamReader] = []

Expand Down

0 comments on commit c5dc08d

Please sign in to comment.