Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(15)

Side by Side Diff: Lib/_pyio.py

Issue 24881: _pyio checks that `os.name == 'win32'` instead of 'nt'
Patch Set: Created 4 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """ 1 """
2 Python implementation of the io module. 2 Python implementation of the io module.
3 """ 3 """
4 4
5 import os 5 import os
6 import abc 6 import abc
7 import codecs 7 import codecs
8 import errno 8 import errno
9 import array 9 import array
10 import stat 10 import stat
11 import sys
11 # Import _thread instead of threading to reduce startup cost 12 # Import _thread instead of threading to reduce startup cost
12 try: 13 try:
13 from _thread import allocate_lock as Lock 14 from _thread import allocate_lock as Lock
14 except ImportError: 15 except ImportError:
15 from _dummy_thread import allocate_lock as Lock 16 from _dummy_thread import allocate_lock as Lock
16 if os.name == 'win32': 17 if sys.platform in {'win32', 'cygwin'}:
17 from msvcrt import setmode as _setmode 18 from msvcrt import setmode as _setmode
18 else: 19 else:
19 _setmode = None 20 _setmode = None
20 21
21 import io 22 import io
22 from io import (__all__, SEEK_SET, SEEK_CUR, SEEK_END) 23 from io import (__all__, SEEK_SET, SEEK_CUR, SEEK_END)
23 24
24 valid_seek_flags = {0, 1, 2} # Hardwired values 25 valid_seek_flags = {0, 1, 2} # Hardwired values
25 if hasattr(os, 'SEEK_HOLE') : 26 if hasattr(os, 'SEEK_HOLE') :
26 valid_seek_flags.add(os.SEEK_HOLE) 27 valid_seek_flags.add(os.SEEK_HOLE)
(...skipping 2491 matching lines...) Expand 10 before | Expand all | Expand 10 after
2518 def errors(self): 2519 def errors(self):
2519 return None 2520 return None
2520 2521
2521 @property 2522 @property
2522 def encoding(self): 2523 def encoding(self):
2523 return None 2524 return None
2524 2525
2525 def detach(self): 2526 def detach(self):
2526 # This doesn't make sense on StringIO. 2527 # This doesn't make sense on StringIO.
2527 self._unsupported("detach") 2528 self._unsupported("detach")
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+