mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 18:22:09 +02:00
handle ctrl-c better when interrupting go test
This commit is contained in:
@@ -158,7 +158,12 @@ def run_python_tests(args: Any, go_proc: 'Optional[subprocess.Popen[bytes]]' = N
|
|||||||
tests = find_all_tests()
|
tests = find_all_tests()
|
||||||
|
|
||||||
def print_go() -> None:
|
def print_go() -> None:
|
||||||
print(go_proc.stdout.read().decode(), end='', flush=True)
|
try:
|
||||||
|
print(go_proc.stdout.read().decode(), end='', flush=True)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
go_proc.terminate()
|
||||||
|
if go_proc.wait(0.1) is None:
|
||||||
|
go_proc.kill()
|
||||||
go_proc.stdout.close()
|
go_proc.stdout.close()
|
||||||
go_proc.wait()
|
go_proc.wait()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user