From c15d8041b493eeff5ad62f210a03686d56f2240c Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Sat, 21 Sep 2024 09:22:24 +1000 Subject: [PATCH] Don't forbid frame variable capture in main scripts (#37) --- 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):