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 3333 import pty
3434except ImportError :
3535 pty = None
36+ try :
37+ import readline as readline_module
38+ except ImportError :
39+ readline_module = None
3640
3741
3842class ReplTestCase (TestCase ):
@@ -1418,9 +1422,12 @@ def test_no_newline(self):
14181422 commands = "print('Something pretty long', end='')\n exit()\n "
14191423 expected_output_sequence = "Something pretty long>>> exit()"
14201424
1421- basic_output , basic_exit_code = self .run_repl (commands , env = env )
1422- self .assertEqual (basic_exit_code , 0 )
1423- self .assertIn (expected_output_sequence , basic_output )
1425+ # gh-143394: The basic REPL needs the readline module to turn off
1426+ # ECHO terminal attribute.
1427+ if readline_module is not None :
1428+ basic_output , basic_exit_code = self .run_repl (commands , env = env )
1429+ self .assertEqual (basic_exit_code , 0 )
1430+ self .assertIn (expected_output_sequence , basic_output )
14241431
14251432 output , exit_code = self .run_repl (commands )
14261433 self .assertEqual (exit_code , 0 )
You can’t perform that action at this time.
0 commit comments