Fix "msvcrt" import warning on Linux when "_ctypes" is not available.
On Linux, compiling without "libffi" causes a
"No module named 'msvcrt'" warning when launching PyREPL.
Console: type[ConsoleType]
_error: tuple[type[Exception], ...] | type[Exception]
-try:
- from .unix_console import UnixConsole as Console, _error
-except ImportError:
+
+if os.name == "nt":
from .windows_console import WindowsConsole as Console, _error
+else:
+ from .unix_console import UnixConsole as Console, _error
ENCODING = sys.getdefaultencoding() or "latin1"