change OutputManager to actually have separate contexts for out and err to scripts can manage both in one place

This commit is contained in:
Fabio Pliger
2022-04-18 15:54:59 -05:00
parent 4d890602d9
commit 00b571d3df
2 changed files with 42 additions and 14 deletions

View File

@@ -115,9 +115,11 @@ export class BaseEvalElement extends HTMLElement {
await this._register_esm(pyodide);
if (source.includes("asyncio")){
await pyodide.runPythonAsync(`output_manager.change("`+this.outputElement.id+`")`);
output = await pyodide.runPythonAsync(source);
await pyodide.runPythonAsync(`output_manager.revert()`)
}else{
output = pyodide.runPython(`output_manager.change("`+this.outputElement.id+`")`);
output = pyodide.runPython(source);
pyodide.runPython(`output_manager.revert()`)
}