| 2698 | if not sys.stdin.isatty() or not sys.stdout.isatty(): |
| 2699 | self.skipTest("stdin and stdout must be ttys") |
| 2700 | def child(wpipe): |
| 2701 | # Check the error handlers are accounted for |
| 2702 | if stdio_encoding: |
| 2703 | sys.stdin = io.TextIOWrapper(sys.stdin.detach(), |
| 2704 | encoding=stdio_encoding, |
| 2705 | errors=stdin_errors) |
| 2706 | sys.stdout = io.TextIOWrapper(sys.stdout.detach(), |
| 2707 | encoding=stdio_encoding, |
| 2708 | errors=stdout_errors) |
| 2709 | print("tty =", sys.stdin.isatty() and sys.stdout.isatty(), file=wpipe) |
| 2710 | try: |
| 2711 | print(ascii(input(prompt)), file=wpipe) |
| 2712 | except BaseException as e: |
| 2713 | print(ascii(f'{e.__class__.__name__}: {e!s}'), file=wpipe) |
| 2714 | with self.detach_readline(): |
| 2715 | lines = self.run_child(child, terminal_input + b"\r\n") |
| 2716 | # Check we did exercise the GNU readline path |