Skip to content
Myr

Revert 60ef759

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

plus reformat the code to clarify that the import can't be moved into the function

authored by Matthias Urlichs · committed by Matthias Urlichs · parent 7eb990f · Browse files · 1 file+7 added−6 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+7 added−6 removed

  • other:+7 added−6 removed

1 file+7 added−6 removed

modified:click/_compat.py+7 added-6 removed
185 unmodified lines
186 return f187188 try:189 import msvcrt190190 except ImportError:191 pass192 else:193 def set_binary_mode(f):194 try:195 fileno = f.fileno()196 except Exception:197 pass198 else:199 msvcrt.setmode(fileno, os.O_BINARY)200 return f199 except ImportError:200 pass201202 try:203 import fcntl204 except ImportError:205 pass206 else:207 def set_binary_mode(f):208 try:209 fileno = f.fileno()210 except Exception:211 pass212 else:209 import fcntl213 flags = fcntl.fcntl(fileno, fcntl.F_GETFL)214 fcntl.fcntl(fileno, fcntl.F_SETFL, flags & ~os.O_NONBLOCK)215 return f213 except ImportError:214 pass216217 def isidentifier(x):218 return _identifier_re.search(x) is not None219
475 unmodified lines