(echo_char)
| 144 | |
| 145 | |
| 146 | def _check_echo_char(echo_char): |
| 147 | # Single-character ASCII excluding control characters |
| 148 | if echo_char is None: |
| 149 | return |
| 150 | if not isinstance(echo_char, str): |
| 151 | raise TypeError("'echo_char' must be a str or None, not " |
| 152 | f"{type(echo_char).__name__}") |
| 153 | if not ( |
| 154 | len(echo_char) == 1 |
| 155 | and echo_char.isprintable() |
| 156 | and echo_char.isascii() |
| 157 | ): |
| 158 | raise ValueError("'echo_char' must be a single printable ASCII " |
| 159 | f"character, got: {echo_char!r}") |
| 160 | |
| 161 | |
| 162 | def _raw_input(prompt="", stream=None, input=None, echo_char=None): |
no test coverage detected