Skip to content
Myr

Set blocking I/O flags for FreeBSD

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

authored by Kwanghee Choi · committed by Kwanghee Choi · parent 2cd71bf · 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
163 unmodified lines
164 # There are also Windows environments where the `msvcrt` module is not165 # available (which is why we use try-catch instead of the WIN variable166 # here), such as the Google App Engine development server on Windows. In167 # those cases there is just nothing we can do.168 def set_binary_mode(f):169 return f170171 try:172 import msvcrt170 except ImportError:171 set_binary_mode = lambda x: x172 else:173174 def set_binary_mode(f):175 try:176 fileno = f.fileno()177 except Exception:178 pass179 else:180 msvcrt.setmode(fileno, os.O_BINARY)181 return f182 except ImportError:183 pass184185 try:186 import fcntl187188 def set_binary_mode(f):189 try:190 fileno = f.fileno()191 except Exception:192 pass193 else:194 flags = fcntl.fcntl(fileno, fcntl.F_GETFL)195 fcntl.fcntl(fileno, fcntl.F_SETFL, flags & ~os.O_NONBLOCK)196 return f197 except ImportError:198 pass199200 def isidentifier(x):201 return _identifier_re.search(x) is not None202203 def get_binary_stdin():
463 unmodified lines