From c2dd1f23d8625b255b8d1bc0aa246d7d799703e1 Mon Sep 17 00:00:00 2001 From: webreflection Date: Wed, 6 May 2026 18:16:15 +0200 Subject: [PATCH] cleanup the env if forced --- core/src/plugins/py-editor.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/core/src/plugins/py-editor.js b/core/src/plugins/py-editor.js index 9583b2bb..de5c51c4 100644 --- a/core/src/plugins/py-editor.js +++ b/core/src/plugins/py-editor.js @@ -282,12 +282,19 @@ const init = async (script, type, interpreter) => { // allow bootstrap with same env for repeated editor creation // only if `env-override` is explicitly set as attribute - if (hasConfig && configs.has(env) && !script.hasAttribute("env-override")) { - throw new SyntaxError( - configs.get(env) - ? `duplicated config for env: ${env}` - : `unable to add a config to the env: ${env}`, - ); + if (hasConfig && configs.has(env)) { + if (script.hasAttribute("env-override")) { + // in this case we need to bootstrap the env again + // because otherwise each env would leak + envs.delete(env); + } + else { + throw new SyntaxError( + configs.get(env) + ? `duplicated config for env: ${env}` + : `unable to add a config to the env: ${env}`, + ); + } } configs.set(env, hasConfig);