Skip to content

Commit 4573b33

Browse files
committed
clean up python-wasm script
1 parent 9295076 commit 4573b33

1 file changed

Lines changed: 3 additions & 14 deletions

File tree

src/livecodes/languages/python-wasm/lang-python-wasm-script.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable no-underscore-dangle */
2-
import { fontAwesomeUrl, pyodideBaseUrl } from '../../vendors';
2+
import { pyodideBaseUrl } from '../../vendors';
33

44
declare const loadPyodide: any;
55

@@ -50,21 +50,13 @@ window.addEventListener('load', async () => {
5050
}
5151

5252
async function prepareEnv() {
53-
// needed for matplotlib icons
54-
const stylesheet = document.createElement('link');
55-
stylesheet.rel = 'stylesheet';
56-
stylesheet.href = fontAwesomeUrl;
57-
document.head.append(stylesheet);
58-
5953
await pyodideReady;
6054
const patchInput = `
6155
from js import prompt
6256
def input(p):
6357
return prompt(p)
6458
__builtins__.input = input
6559
`.trim();
66-
// in Pyodide v0.26.x runPythonAsync does not resolve in the following times
67-
// use runPython instead
6860
await livecodes.pyodide.runPythonAsync(patchInput);
6961
}
7062

@@ -82,9 +74,8 @@ __builtins__.input = input
8274
try {
8375
await livecodes.micropip.install(pkg);
8476
} catch (err) {
85-
// in Pyodide v0.26.x this needs to be done,
86-
// otherwise the following micropip installs do not resolve
87-
// livecodes.excludedPackages.push(pkg);
77+
// eslint-disable-next-line no-console
78+
console.log(err);
8879
}
8980
}
9081
}
@@ -96,8 +87,6 @@ __builtins__.input = input
9687
await loadPackagesInCode(code);
9788
try {
9889
livecodes.pyodideState = livecodes.pyodide.pyodide_py._state.save_state();
99-
// in Pyodide v0.26.x runPythonAsync does not resolve in the following times
100-
// use runPython instead
10190
await livecodes.pyodide.runPythonAsync(code);
10291
} catch (err) {
10392
// eslint-disable-next-line no-console

0 commit comments

Comments
 (0)