From c9bfa615198b7dc22e14a1b216f53e58d98c9773 Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Thu, 19 Sep 2024 19:24:21 +1000 Subject: [PATCH] Don't forbid frame variable capture in main scripts --- napari_console/qt_console.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/napari_console/qt_console.py b/napari_console/qt_console.py index 2033755..cd94dd2 100644 --- a/napari_console/qt_console.py +++ b/napari_console/qt_console.py @@ -178,7 +178,7 @@ def _capture(self): Capture variable from first enclosing scope that is not napari """ with CallerFrame(self._in_napari) as c: - if c.frame.f_globals.get("__name__", "") != "__main__" and "NAPARI_EMBED" not in c.frame.f_globals: + if "NAPARI_EMBED" not in c.frame.f_globals: self.push(dict(c.namespace)) def _update_theme(self, event=None):