Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge pull request #1813 from mdboom/gtk3-version-check
GTK segfault with GTK3 and mpl_toolkits
  • Loading branch information
mdboom committed May 28, 2013
commit 130b6fcc034c46fcef2f0f0d55640878b28ee29f
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