(console: code.InteractiveConsole, unicodetext: str)
| 79 | |
| 80 | |
| 81 | def _more_lines(console: code.InteractiveConsole, unicodetext: str) -> bool: |
| 82 | # ooh, look at the hack: |
| 83 | src = _strip_final_indent(unicodetext) |
| 84 | try: |
| 85 | code = console.compile(src, "<stdin>", "single") |
| 86 | except (OverflowError, SyntaxError, ValueError): |
| 87 | lines = src.splitlines(keepends=True) |
| 88 | if len(lines) == 1: |
| 89 | return False |
| 90 | |
| 91 | last_line = lines[-1] |
| 92 | was_indented = last_line.startswith((" ", "\t")) |
| 93 | not_empty = last_line.strip() != "" |
| 94 | incomplete = not last_line.endswith("\n") |
| 95 | return (was_indented or not_empty) and incomplete |
| 96 | else: |
| 97 | return code is None |
| 98 | |
| 99 | |
| 100 | def run_multiline_interactive_console( |
searching dependent graphs…