mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-07 09:01:13 -05:00
chore(deps): update @freecodecamp/curriculum helpers to v8.0.0 (#66240)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
import { loadPyodide, type PyodideInterface } from 'pyodide/pyodide.js';
|
||||
import pkg from 'pyodide/package.json';
|
||||
import type { PyProxy, PythonError } from 'pyodide/ffi';
|
||||
import * as helpers from '@freecodecamp/curriculum-helpers';
|
||||
import { formatException } from '@freecodecamp/curriculum-helpers';
|
||||
|
||||
const ctx: Worker & typeof globalThis = self as unknown as Worker &
|
||||
typeof globalThis;
|
||||
@@ -59,13 +59,9 @@ async function setupPyodide() {
|
||||
Object.freeze(self);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
||||
pyodide.FS.writeFile(
|
||||
'/home/pyodide/ast_helpers.py',
|
||||
helpers.python.astHelpers,
|
||||
{
|
||||
encoding: 'utf8'
|
||||
}
|
||||
);
|
||||
pyodide.FS.writeFile('/home/pyodide/format_exception.py', formatException, {
|
||||
encoding: 'utf8'
|
||||
});
|
||||
|
||||
ignoreRunMessages = true;
|
||||
postMessage({ type: 'stopped' });
|
||||
@@ -170,7 +166,7 @@ function initRunPython() {
|
||||
`);
|
||||
runPython(`
|
||||
def print_exception():
|
||||
from ast_helpers import format_exception
|
||||
from format_exception import format_exception
|
||||
formatted = format_exception(exception=sys.last_value, traceback=sys.last_traceback, filename="<exec>", new_filename="main.py")
|
||||
print(formatted)
|
||||
`);
|
||||
|
||||
Reference in New Issue
Block a user