Commit 8173bb9a authored by Romain Casati's avatar Romain Casati
Browse files

Ignore errors of previous execution (run_complete catch).

parent 6c49d377
......@@ -148,5 +148,5 @@ class InteractiveConsole(_pyodide_console.InteractiveConsole):
def callback(*args):
return self.run_script(code)
self.run_complete = self.run_complete.then(callback)
self.run_complete = self.run_complete.catch(lambda *a: None).then(callback)
return self.run_complete
......@@ -38,6 +38,7 @@ except ImportError:
def __init__(self, args=None):
self.args = (args,) if args is not None else ()
self.catch = self.then
def then(self, func, *args):
return _FakePromise(func(*self.args))
......@@ -244,7 +245,7 @@ class InteractiveConsole(code.InteractiveConsole):
return _dummy_promise
return _load_packages_from_imports(source).then(run)
self.run_complete = self.run_complete.then(load_packages_and_run)
self.run_complete = self.run_complete.catch(lambda *a: None).then(load_packages_and_run)
def __del__(self):
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