From: Victor Stinner Date: Fri, 15 May 2026 21:11:09 +0000 (+0200) Subject: gh-149879: Don't import msvcrt in _pyio on Cygwin (#149899) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1441f2f7351f030ba07c6c6b11be513ad1c9104f;p=thirdparty%2FPython%2Fcpython.git gh-149879: Don't import msvcrt in _pyio on Cygwin (#149899) The msvcrt extension module cannot be built on Cygwin. --- diff --git a/Lib/_pyio.py b/Lib/_pyio.py index 3306c8a27476..1b5b75ef566a 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -10,7 +10,7 @@ import stat import sys # Import _thread instead of threading to reduce startup cost from _thread import allocate_lock as Lock -if sys.platform in {'win32', 'cygwin'}: +if sys.platform == 'win32': from msvcrt import setmode as _setmode else: _setmode = None