Skip to content

Commit 3bcc18a

Browse files
committed
Fix a possible crash when embedding in GTK
Opening the subplot tool in the embedding pan/zoom example fails since the GApplication isn't created by Matplotlib.
1 parent d358cc3 commit 3bcc18a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/backends/_backend_gtk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def _create_application():
4343

4444
if _application is None:
4545
app = Gio.Application.get_default()
46-
if app is None or getattr(app, '_created_by_matplotlib'):
46+
if app is None or getattr(app, '_created_by_matplotlib', False):
4747
# display_is_valid returns False only if on Linux and neither X11
4848
# nor Wayland display can be opened.
4949
if not mpl._c_internal_utils.display_is_valid():

0 commit comments

Comments
 (0)