(
stream: t.BinaryIO | t.TextIO,
)
| 39 | |
| 40 | |
| 41 | def _has_binary_buffer( |
| 42 | stream: t.BinaryIO | t.TextIO, |
| 43 | ) -> t.TypeGuard[_BufferedTextPagerStream]: |
| 44 | # TextIO is wider than TextIOWrapper; text-only streams such as StringIO |
| 45 | # are valid TextIO values but do not expose a binary buffer to wrap. |
| 46 | return getattr(stream, "buffer", None) is not None |
| 47 | |
| 48 | |
| 49 | if os.name == "nt": |