Commit 345cef4c authored by Romain Casati's avatar Romain Casati
Browse files

Fix: flush should occure after each evaluation.

parent 9f98a987
......@@ -117,6 +117,11 @@ class InteractiveConsole(_pyodide_console.InteractiveConsole):
raise
except Exception:
self.showtraceback()
# in CPython's REPL, flush is performed
# by input(prompt) at each new prompt ;
# since we are not using input, we force
# flushing here
self.flush_all()
self.roll_out_history(result)
if result is not None:
......
......@@ -40,6 +40,12 @@ def test_errors(selenium):
assert 'result' not in data['result'] and data['stdout'] == ""
def test_flush(selenium):
# flushing should be performed even if not forced
data = selenium.run_basthon("print('foo', end='bar')")
assert data['stdout'] == 'foobar'
def test_put_file(selenium):
selenium.run_js("""
window.toBytesArray = function(string) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment