8000 Backport PR #12929 on branch v3.0.x (FIX: skip gtk backend if gobject but not pygtk is installed) by meeseeksmachine · Pull Request #12972 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Backport PR #12929 on branch v3.0.x (FIX: skip gtk backend if gobject but not pygtk is installed) #12972

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
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
10 changes: 9 additions & 1 deletion lib/matplotlib/backends/_gtk3_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@

if gi.__name__ == "pgi" and gi.version_info < (0, 0, 11, 2):
raise ImportError("The GTK3 backends are incompatible with pgi<0.0.11.2")
gi.require_version("Gtk", "3.0")
try:
# :raises ValueError: If module/version is already loaded, already
# required, or unavailable.
gi.require_version("Gtk", "3.0")
except ValueError as e:
# in this case we want to re-raise as ImportError so the
# auto-backend selection logic correctly skips.
raise ImportError from e

globals().update(
{name:
importlib.import_module("{}.repository.{}".format(gi.__name__, name))
Expand Down
0