diff --git a/src/ffi.ts b/src/ffi.ts index 1df28b4..67a5116 100644 --- a/src/ffi.ts +++ b/src/ffi.ts @@ -9,7 +9,11 @@ const DENO_PYTHON_PATH = Deno.env.get("DENO_PYTHON_PATH"); if (DENO_PYTHON_PATH) { searchPath.push(DENO_PYTHON_PATH); } else { - if (Deno.build.os === "windows" || Deno.build.os === "linux" || Deno.build.os === "windows_nt") { + if ( + Deno.build.os === "windows" || Deno.build.os === "linux" || + // @ts-ignore: users reported that `windows_nt` exists at runtime + Deno.build.os === "windows_nt" + ) { searchPath.push( ...SUPPORTED_VERSIONS.map(([major, minor]) => `${Deno.build.os === "linux" ? "lib" : ""}python${major}${ diff --git a/src/python.ts b/src/python.ts index 15af63d..bc05479 100644 --- a/src/python.ts +++ b/src/python.ts @@ -824,7 +824,7 @@ export class PyObject { /** Python-related error. */ export class PythonError extends Error { - name = "PythonError"; + override name = "PythonError"; constructor( public type: PyObject, @@ -947,6 +947,7 @@ export class Python { .handle, ); if (module === null) { + maybeThrowError(); throw new EvalError("Failed to run python module"); } return new PyObject(module)?.proxy;