Skip to content

GTK segfault with GTK3 and mpl_toolkits #1813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 28, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion lib/matplotlib/backends/backend_gtk3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@
import os, sys
def fn_name(): return sys._getframe(1).f_code.co_name

try:
import gi
except ImportError:
raise ImportError("Gtk3 backend requires pygobject to be installed.")

try:
gi.require_version("Gtk", "3.0")
except ValueError:
raise ImportError(
"Gtk3 backend requires the GObject introspection bindings for Gtk 3 "
"to be installed.")

try:
from gi.repository import Gtk, Gdk, GObject
except ImportError:
raise ImportError("GTK3 backend requires pygobject to be installed.")
raise ImportError("Gtk3 backend requires pygobject to be installed.")

import matplotlib
from matplotlib._pylab_helpers import Gcf
Expand Down