From 4e2c16c0f2c530bc1bf5a3bb4c0b824189720a9b Mon Sep 17 00:00:00 2001 From: Muspi Merol Date: Sat, 24 Aug 2024 03:59:30 +0800 Subject: [PATCH] fix: `api`, `utils` and `bridge` should unload too --- reasonify-headless/load.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reasonify-headless/load.py b/reasonify-headless/load.py index 13eeb52..3b7d741 100644 --- a/reasonify-headless/load.py +++ b/reasonify-headless/load.py @@ -15,5 +15,7 @@ if __debug__: for module in tuple(sys.modules): # for HMR - if module.startswith("reasonify") or module.startswith("promplate_recipes"): - del sys.modules[module] + for prefix in ("reasonify", "promplate_recipes", "api", "utils", "bridge"): + if module.startswith(prefix): + del sys.modules[module] + break