From 236f9c698eb37be351001de198a5fc591e718d71 Mon Sep 17 00:00:00 2001 From: Philipp Schlegel Date: Sun, 15 Sep 2024 16:42:48 +0200 Subject: [PATCH] plot3d (octarine): correctly detect closed viewer --- navis/plotting/ddd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/navis/plotting/ddd.py b/navis/plotting/ddd.py index 6c465c5a..2a507b5d 100644 --- a/navis/plotting/ddd.py +++ b/navis/plotting/ddd.py @@ -496,12 +496,12 @@ def plot3d_octarine(x, **kwargs): # Check if any existing viewer has already been closed if isinstance(getattr(config, "primary_viewer", None), oc.Viewer): try: - _ = getattr(config, "primary_viewer").canvas + getattr(config, "primary_viewer").canvas.__repr__() except RuntimeError: config.primary_viewer = None if settings.viewer in (None, "new"): - # If it does not exists yet, initialise a canvas object and make global + # If it does not exists yet, initialize a canvas object and make global if ( not isinstance(getattr(config, "primary_viewer", None), oc.Viewer) or settings.viewer == "new"