File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 4444 import pty
4545except ImportError :
4646 pty = None
47+ try :
48+ import readline as readline_module
49+ except ImportError :
50+ readline_module = None
4751
4852
4953class ReplTestCase (TestCase ):
@@ -1947,9 +1951,12 @@ def test_no_newline(self):
19471951 commands = "print('Something pretty long', end='')\n exit()\n "
19481952 expected_output_sequence = "Something pretty long>>> exit()"
19491953
1950- basic_output , basic_exit_code = self .run_repl (commands , env = env )
1951- self .assertEqual (basic_exit_code , 0 )
1952- self .assertIn (expected_output_sequence , basic_output )
1954+ # gh-143394: The basic REPL needs the readline module to turn off
1955+ # ECHO terminal attribute.
1956+ if readline_module is not None :
1957+ basic_output , basic_exit_code = self .run_repl (commands , env = env )
1958+ self .assertEqual (basic_exit_code , 0 )
1959+ self .assertIn (expected_output_sequence , basic_output )
19531960
19541961 output , exit_code = self .run_repl (commands )
19551962 self .assertEqual (exit_code , 0 )
You can’t perform that action at this time.
0 commit comments