gh-149879: Don't import msvcrt in _pyio on Cygwin (#149899)

The msvcrt extension module cannot be built on Cygwin.
This commit is contained in:
Victor Stinner 2026-05-15 23:11:09 +02:00 committed by GitHub
parent c92ef3a6de
commit 1441f2f735
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,7 +10,7 @@
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