Skip to content

Commit

Permalink
Merge pull request #1813 from mdboom/gtk3-version-check
Browse files Browse the repository at this point in the history
GTK segfault with GTK3 and mpl_toolkits
  • Loading branch information
mdboom committed May 28, 2013
2 parents 220306b + a35116c commit dd38945
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/matplotlib/backends/backend_gtk3.py
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

0 comments on commit dd38945

Please sign in to comment.