Skip to content

Commit b71a1b8

Browse files
committed
First pass at CI failures
1 parent 95f0d33 commit b71a1b8

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

newsfragments/3007.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Make ctrl+c work in more situations in the Trio REPL (``python -m trio``).

src/trio/_repl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def terminal_newline() -> None:
2929
# Fake up a newline char as if user had typed it at the terminal
3030
# on a best-effort basis
3131
with contextlib.suppress(OSError):
32-
fcntl.ioctl(sys.stdin, termios.TIOCSTI, b"\n")
32+
fcntl.ioctl(sys.stdin, termios.TIOCSTI, b"\n") # type: ignore[attr-defined, unused-ignore]
3333

3434

3535
@final

src/trio/_tests/test_repl.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
import os
4-
import pty
54
import signal
65
import subprocess
76
import sys
@@ -247,11 +246,15 @@ def test_main_entrypoint() -> None:
247246

248247
@pytest.mark.skipif(sys.platform == "win32", reason="uses PTYs")
249248
def test_ki_newline_injection() -> None:
249+
assert sys.platform != "win32"
250+
251+
import pty
252+
250253
# NOTE: this cannot be subprocess.Popen because pty.fork
251254
# does some magic to set the controlling terminal.
252255
# (which I don't know how to replicate... so I copied this
253256
# structure from pty.spawn...)
254-
pid, pty_fd = pty.fork()
257+
pid, pty_fd = pty.fork() # type: ignore[attr-defined,unused-ignore]
255258
if pid == 0:
256259
os.execlp(sys.executable, *[sys.executable, "-u", "-m", "trio"])
257260

0 commit comments

Comments
 (0)