(echo_char)
| 195 | |
| 196 | |
| 197 | def _check_echo_char(echo_char): |
| 198 | # Single-character ASCII excluding control characters |
| 199 | if echo_char is None: |
| 200 | return |
| 201 | if not isinstance(echo_char, str): |
| 202 | raise TypeError("'echo_char' must be a str or None, not " |
| 203 | f"{type(echo_char).__name__}") |
| 204 | if not ( |
| 205 | len(echo_char) == 1 |
| 206 | and echo_char.isprintable() |
| 207 | and echo_char.isascii() |
| 208 | ): |
| 209 | raise ValueError("'echo_char' must be a single printable ASCII " |
| 210 | f"character, got: {echo_char!r}") |
| 211 | |
| 212 | |
| 213 | def _raw_input(prompt="", stream=None, input=None, echo_char=None, |
no test coverage detected
searching dependent graphs…