diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-08-28 22:20:29 +0300 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-08-28 22:20:29 +0300 |
commit | ccb31673a68f700489540212fad14b749add05a1 (patch) | |
tree | ec4275617f316ee125770643af81ed43c1c13340 /Lib/_pyio.py | |
parent | Issue #21112: Fix regression in unittest.expectedFailure on subclasses. (diff) | |
parent | Issue #24881: Fixed setting binary mode in Python implementation of FileIO (diff) | |
download | cpython-ccb31673a68f700489540212fad14b749add05a1.tar.gz cpython-ccb31673a68f700489540212fad14b749add05a1.tar.bz2 cpython-ccb31673a68f700489540212fad14b749add05a1.zip |
Issue #24881: Fixed setting binary mode in Python implementation of FileIO
on Windows and Cygwin. Patch from Akira Li.
Diffstat (limited to 'Lib/_pyio.py')
-rw-r--r-- | Lib/_pyio.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/_pyio.py b/Lib/_pyio.py index 33d8a3f8e0b..f4722561fb9 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -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 |