Skip to content

Commit

Permalink
fix: mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
renan-r-santos committed Apr 17, 2024
1 parent b87a759 commit da07699
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pixi_kernel/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import sys
import typing
from pathlib import Path
from types import FrameType

from ipykernel.ipkernel import IPythonKernel
from ipykernel.kernelapp import IPKernelApp
Expand Down Expand Up @@ -64,16 +65,17 @@ def main() -> None:

logger.info(f"launching {kernel_display_name} kernel with {args}")

if platform.system() == "Windows":
if sys.platform == "win32":
process = subprocess.Popen(args, env=env)

forward_signals = set(signal.Signals) - {
signal.CTRL_BREAK_EVENT,
signal.CTRL_C_EVENT,
signal.SIGBREAK,
signal.SIGTERM,
}

def handle_signal(sig, frame):
def handle_signal(sig: int, frame: FrameType | None) -> None:
process.send_signal(sig)

for sig in forward_signals:
Expand Down

0 comments on commit da07699

Please sign in to comment.