Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

FIX: skip gtk backend if gobject but not pygtk is installed #12929

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 1 commit into from
Dec 10, 2018

Conversation

tacaswell
Copy link
Member

It is possible to install gobject (which provides gi) but not
pygtk (which provide the GTK bindings). This try-except converts
the ValueError that gi raises to an ImportError so our machinery works
correctly.

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

It is possible to install gobject (which provides `gi`) but not
pygtk (which provide the `GTK` bindings).  This try-except converts
the ValueError that gi raises to an ImportError so our machinery works
correctly.
@tacaswell tacaswell added this to the v3.0.3 milestone Dec 4, 2018
@tacaswell
Copy link
Member Author

marking to backport as this fixes a failure-to-import bug.

@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not shure what the leading colon is for, but heh.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copy-pasted their docstring (which uses the google style docstrings)

@anntzer anntzer merged commit b105ab2 into matplotlib:master Dec 10, 2018
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Dec 10, 2018
QuLogic added a commit that referenced this pull request Dec 10, 2018
…929-on-v3.0.x

Backport PR #12929 on branch v3.0.x (FIX: skip gtk backend if gobject but not pygtk is installed)
@tacaswell tacaswell deleted the fix_gtk_failure branch December 10, 2018 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.