Skip to content
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

Fix building when Gtk doesn't support version check #1900

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 14 additions & 10 deletions setupext.py
Expand Up @@ -1408,11 +1408,13 @@ def backend_gtk3agg_internal_check(x):
if sys.version_info[0] >= 3: if sys.version_info[0] >= 3:
return (False, "gtk3agg does not work on Python 3") return (False, "gtk3agg does not work on Python 3")


return (True, "version %s.%s.%s" % ( try:
Gtk.get_major_version(), return (True, "version %s.%s.%s" % (
Gtk.get_micro_version(), Gtk.get_major_version(),
Gtk.get_minor_version())) Gtk.get_micro_version(),

Gtk.get_minor_version()))
except AttributeError:
return (True, "version unknown")


class BackendGtk3Agg(OptionalBackendPackage): class BackendGtk3Agg(OptionalBackendPackage):
name = "gtk3agg" name = "gtk3agg"
Expand Down Expand Up @@ -1450,11 +1452,13 @@ def backend_gtk3cairo_internal_check(x):
except ImportError: except ImportError:
return (False, "Requires pygobject to be installed.") return (False, "Requires pygobject to be installed.")


return (True, "version %s.%s.%s" % ( try:
Gtk.get_major_version(), return (True, "version %s.%s.%s" % (
Gtk.get_micro_version(), Gtk.get_major_version(),
Gtk.get_minor_version())) Gtk.get_micro_version(),

Gtk.get_minor_version()))
except AttributeError:
return (True, "version unknown")


class BackendGtk3Cairo(OptionalBackendPackage): class BackendGtk3Cairo(OptionalBackendPackage):
name = "gtk3cairo" name = "gtk3cairo"
Expand Down