Skip to content

Commit

Permalink
Ensure kernel variables are cloned before updating
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Oct 5, 2024
1 parent 4151b43 commit 1c257a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/kernels/raw/launcher/kernelEnvVarsService.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export class KernelEnvironmentVariablesService {
kernelSpec: IJupyterKernelSpec,
token?: CancellationToken
) {
let kernelEnv = kernelSpec.env && Object.keys(kernelSpec.env).length > 0 ? kernelSpec.env : undefined;
let kernelEnv =
kernelSpec.env && Object.keys(kernelSpec.env).length > 0 ? Object.assign({}, kernelSpec.env) : undefined;
const isPythonKernel = (kernelSpec.language || '').toLowerCase() === PYTHON_LANGUAGE;
// If an interpreter was not explicitly passed in, check for an interpreter path in the kernelspec to use
if (!interpreter && kernelSpec.interpreterPath) {
Expand Down

0 comments on commit 1c257a0

Please sign in to comment.