mirror of
https://github.com/python/cpython.git
synced 2024-11-24 02:15:30 +08:00
Issue #24881: Fixed setting binary mode in Python implementation of FileIO
on Windows and Cygwin. Patch from Akira Li.
This commit is contained in:
parent
079fc7faff
commit
f0f55a00b7
@ -8,12 +8,13 @@ import codecs
|
||||
import errno
|
||||
import array
|
||||
import stat
|
||||
import sys
|
||||
# Import _thread instead of threading to reduce startup cost
|
||||
try:
|
||||
from _thread import allocate_lock as Lock
|
||||
except ImportError:
|
||||
from _dummy_thread import allocate_lock as Lock
|
||||
if os.name == 'win32':
|
||||
if sys.platform in {'win32', 'cygwin'}:
|
||||
from msvcrt import setmode as _setmode
|
||||
else:
|
||||
_setmode = None
|
||||
|
Loading…
Reference in New Issue
Block a user