(console: code.InteractiveConsole, unicodetext: str)
| 84 | |
| 85 | |
| 86 | def _more_lines(console: code.InteractiveConsole, unicodetext: str) -> bool: |
| 87 | # ooh, look at the hack: |
| 88 | src = _strip_final_indent(unicodetext) |
| 89 | try: |
| 90 | code = console.compile(src, "<stdin>", "single") |
| 91 | except (OverflowError, SyntaxError, ValueError): |
| 92 | lines = src.splitlines(keepends=True) |
| 93 | if len(lines) == 1: |
| 94 | return False |
| 95 | |
| 96 | last_line = lines[-1] |
| 97 | was_indented = last_line.startswith((" ", "\t")) |
| 98 | not_empty = last_line.strip() != "" |
| 99 | incomplete = not last_line.endswith("\n") |
| 100 | return (was_indented or not_empty) and incomplete |
| 101 | else: |
| 102 | return code is None |
| 103 | |
| 104 | |
| 105 | def run_multiline_interactive_console( |
nothing calls this directly
no test coverage detected