Skip to content
Myr

Merge branch 'pr/954'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parents 5d1df0e, abe982c · Browse files · 1 file+21 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+21 added−3 removed

  • other:+21 added−3 removed

1 file+21 added−3 removed

modified:click/_compat.py+21 added-3 removed
165 unmodified lines
166 # There are also Windows environments where the `msvcrt` module is not167 # available (which is why we use try-catch instead of the WIN variable168 # here), such as the Google App Engine development server on Windows. In169 # those cases there is just nothing we can do.170 def set_binary_mode(f):171 return f172173 try:174 import msvcrt172 except ImportError:173 set_binary_mode = lambda x: x174 else:175176 def set_binary_mode(f):177 try:178 fileno = f.fileno()179 except Exception:180 pass181 else:182 msvcrt.setmode(fileno, os.O_BINARY)183 return f184 except ImportError:185 pass186187 try:188 import fcntl189190 def set_binary_mode(f):191 try:192 fileno = f.fileno()193 except Exception:194 pass195 else:196 flags = fcntl.fcntl(fileno, fcntl.F_GETFL)197 fcntl.fcntl(fileno, fcntl.F_SETFL, flags & ~os.O_NONBLOCK)198 return f199 except ImportError:200 pass201202 def isidentifier(x):203 return _identifier_re.search(x) is not None204205 def get_binary_stdin():
464 unmodified lines