gh-111201: Support pyrepl on Windows (#119559)

Co-authored-by: Anthony Shaw <anthony.p.shaw@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
Dino Viehland 2024-05-31 00:49:03 -07:00 committed by GitHub
parent 13a5fdc72f
commit 0d07182821
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 1020 additions and 49 deletions

View file

@ -1,12 +1,16 @@
import itertools
import sys
import unittest
from functools import partial
from unittest import TestCase
from unittest.mock import MagicMock, call, patch, ANY
from .support import handle_all_events, code_to_events
from _pyrepl.console import Event
from _pyrepl.unix_console import UnixConsole
try:
from _pyrepl.console import Event
from _pyrepl.unix_console import UnixConsole
except ImportError:
pass
def unix_console(events, **kwargs):
console = UnixConsole()
@ -67,6 +71,7 @@ TERM_CAPABILITIES = {
}
@unittest.skipIf(sys.platform == "win32", "No Unix event queue on Windows")
@patch("_pyrepl.curses.tigetstr", lambda s: TERM_CAPABILITIES.get(s))
@patch(
"_pyrepl.curses.tparm",