mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.14] gh-131189: Fix "msvcrt" import warning on Linux when "_ctypes" is not available. (GH-131201) (GH-136668)
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.
(cherry picked from commit f320c951c3)
Co-authored-by: Dzmitry Plashchynski <plashchynski@gmail.com>
This commit is contained in:
parent
088d79e3ee
commit
115477399b
1 changed files with 4 additions and 3 deletions
|
|
@ -43,10 +43,11 @@
|
||||||
|
|
||||||
Console: type[ConsoleType]
|
Console: type[ConsoleType]
|
||||||
_error: tuple[type[Exception], ...] | type[Exception]
|
_error: tuple[type[Exception], ...] | type[Exception]
|
||||||
try:
|
|
||||||
from .unix_console import UnixConsole as Console, _error
|
if os.name == "nt":
|
||||||
except ImportError:
|
|
||||||
from .windows_console import WindowsConsole as Console, _error
|
from .windows_console import WindowsConsole as Console, _error
|
||||||
|
else:
|
||||||
|
from .unix_console import UnixConsole as Console, _error
|
||||||
|
|
||||||
ENCODING = sys.getdefaultencoding() or "latin1"
|
ENCODING = sys.getdefaultencoding() or "latin1"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue