Skip to content

Commit

Permalink
Fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodmane committed Oct 5, 2023
1 parent 038db49 commit e236a4d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/js/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ import { loadBinaryFile } from "./compat";
import { version } from "./version";
import "./error_handling.gen.js";
import { setStdin, setStdout, setStderr } from "./streams";
import { makeWarnOnce } from "./pyodide_util";
import { TypedArray } from "./lib";

// Exported for micropip
API.loadBinaryFile = loadBinaryFile;

/**
* Runs code after python vm has been initialized but prior to any bootstrapping.
*/
Expand Down
14 changes: 11 additions & 3 deletions src/js/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ declare global {
// _hiwire_new, _hiwire_intern, _hiwire_num_refs, _hiwire_get,
// _hiwire_incref, _hiwire_decref, and _hiwire_pop
//
// _PyUnicode_New, __PyLong_FromByteArray, _PyLong_FromDouble,
// _PyFloat_FromDouble, _PyList_New, _PyDict_New, _PySet_New, _PySet_Add
// _PyUnicode_New,
// __PyLong_FromByteArray, _PyLong_FromDouble, _PyFloat_FromDouble,
// _PyList_New, _PyDict_New, _PyDict_SetItem, _PySet_New, _PySet_Add
// _PyEval_SaveThread, _PyEval_RestoreThread,
// _PyErr_CheckSignals, _PyErr_SetString
export const _free: (a: number) => void;
export const __PyTraceback_Add: (a: number, b: number, c: number) => void;
export const _PyRun_SimpleString: (ptr: number) => number;
Expand All @@ -64,7 +67,8 @@ declare global {
// Our own functions we use from JavaScript. These all need to be labeled with
// EMSCRIPTEN_KEEPALIVE
declare global {
// also: _JsString_FromId, _wrap_exception, _PyUnicode_Data, __js2python_none, __js2python_true, __js2python_false, __js2python_pyproxy,
// also: _JsString_FromId, _wrap_exception, _PyUnicode_Data, __js2python_none,
// __js2python_true, __js2python_false, __js2python_pyproxy, _JsBuffer_CopyIntoMemoryView
export const _check_gil: () => void;
export const _dump_traceback: () => void;
export const _pythonexc2js: () => void;
Expand Down Expand Up @@ -292,6 +296,10 @@ export interface API {
lockfile_unvendored_stdlibs_and_test: string[];
repodata_packages: any;
repodata_info: any;
loadBinaryFile: (
path: string,
file_sub_resource_hash?: string | undefined,
) => Promise<Uint8Array>;

_pyodide: any;
pyodide_py: any;
Expand Down

0 comments on commit e236a4d

Please sign in to comment.