Browse code

Fixed cairo.FontOptions error on older PyGObject versions.

Timo Vanwynsberghe authored on 03/04/2013 22:49:21 • Jose Fonseca committed on 14/07/2015 21:19:25
Showing 1 changed files

  • xdot.py index 4cd911a..fdb3a00 100755
... ...
@@ -135,6 +135,10 @@ class TextShape(Shape):
135 135
                 # XXX: Some broken pangocairo bindings show the error
136 136
                 # 'TypeError: font_options must be a cairo.FontOptions or None'
137 137
                 pass
138
+            except KeyError:
139
+                # cairo.FontOptions is not registered as a foreign struct in older PyGObject versions.
140
+                # https://git.gnome.org/browse/pygobject/commit/?id=b21f66d2a399b8c9a36a1758107b7bdff0ec8eaa
141
+                pass
138 142
 
139 143
             # set font
140 144
             font = Pango.FontDescription()