Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Basthon
Basthon Kernel
Commits
b69dcd39
Commit
b69dcd39
authored
Jan 30, 2021
by
Romain Casati
Browse files
Removing 'Unknown package 'basthon'' error.
parent
8d658070
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/basthon-js/basthon.js
View file @
b69dcd39
...
...
@@ -107,8 +107,14 @@
that
.
addEventListener
(
"
eval.request
"
,
that
.
evalFromEvent
);
// get the version of Python from Python
that
.
pythonVersion
=
pyodide
.
runPython
(
"
import platform ; platform.python_version()
"
);
return
pyodide
.
loadPackage
(
that
.
basthonRoot
+
"
/basthon-py/basthon.js
"
).
then
(
()
=>
pyodide
.
runPythonAsync
(
"
import basthon
"
));
// this is for avoiding "Unknown package 'basthon'" error
// but can be removed with 0.17.0 since it is fixed upstream
const
consoleErrorBck
=
console
.
error
;
console
.
error
=
()
=>
{};
return
pyodide
.
loadPackage
(
that
.
basthonRoot
+
"
/basthon-py/basthon.js
"
).
then
(()
=>
{
pyodide
.
runPythonAsync
(
"
import basthon
"
);
console
.
error
=
consoleErrorBck
;
});
};
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment