try:
import readline # NoQA
except ImportError:
- pass
+ readline = None
interactive_hook = getattr(sys, "__interactivehook__", None)
except:
pass
else:
- completer = rlcompleter.Completer(console.locals)
- readline.set_completer(completer.complete)
+ if readline is not None:
+ completer = rlcompleter.Completer(console.locals)
+ readline.set_completer(completer.complete)
repl_thread = REPLThread()
repl_thread.daemon = True
from textwrap import dedent
from test import support
from test.support import cpython_only, has_subprocess_support, SuppressCrashReport
-from test.support.script_helper import kill_python
+from test.support.script_helper import kill_python, assert_python_ok
from test.support.import_helper import import_module
expected = "(30, None, [\'def foo(x):\\n\', \' return x + 1\\n\', \'\\n\'], \'<stdin>\')"
self.assertIn(expected, output, expected)
+ def test_asyncio_repl_is_ok(self):
+ assert_python_ok("-m", "asyncio")
+
class TestInteractiveModeSyntaxErrors(unittest.TestCase):