MCPcopy
hub / github.com/pallets/click / _is_binary_writer

Function _is_binary_writer

src/click/_compat.py:160–170  ·  view source on GitHub ↗
(stream: t.IO[t.Any], default: bool = False)

Source from the content-addressed store, hash-verified

158
159
160def _is_binary_writer(stream: t.IO[t.Any], default: bool = False) -> bool:
161 try:
162 stream.write(b"")
163 except Exception:
164 try:
165 stream.write("")
166 return False
167 except Exception:
168 pass
169 return default
170 return True
171
172
173def _find_binary_reader(stream: t.IO[t.Any]) -> t.BinaryIO | None:

Callers 1

_find_binary_writerFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…