Skip to content

Commit 134ccfe

Browse files
Enable Kernels to be built on top of kernlSpec arguments (jupyterlite#210)
* Enable Kernels to be built on top of kernlSpec arguments * apply suggestion * better formatting * Update packages/xeus/src/worker.ts Co-authored-by: martinRenou <[email protected]> --------- Co-authored-by: martinRenou <[email protected]> (cherry picked from commit ddcb13c)
1 parent 9b76541 commit 134ccfe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/xeus/src/worker.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,10 @@ export class XeusRemoteKernel {
179179
});
180180
}
181181

182-
rawXKernel = new globalThis.Module.xkernel();
182+
// backward compatibility: Checking if the kernel constructor takes argument or not
183+
rawXKernel = globalThis.Module.xkernel.length
184+
? new globalThis.Module.xkernel(kernelSpec.argv)
185+
: new globalThis.Module.xkernel();
183186
rawXServer = rawXKernel.get_server();
184187
if (!rawXServer) {
185188
console.error('Failed to start kernel!');

0 commit comments

Comments
 (0)