Commit 01c3ce1
committed
Simplify/improve check for pycairo in Gtk-based backends.
Gtk-based backends require pycairo (cairocffi is unsupported:
https://pygobject.readthedocs.io/en/latest/guide/cairo_integration.html).
Prior to this patch, trying to run gtk{3,4}{agg,cairo} fails *at draw
time* `TypeError: Couldn't find foreign struct converter for 'cairo.Context'`).
This patch moves the import check for cairo to the top of the common
_backend_gtk, and also simplifies backend_gtk{3,4}agg to always use
pycairo (in which case backend_cairo._to_context is a no-op) as they
cannot inter-operate with cairocffi anyways.1 parent 3522217 commit 01c3ce1
File tree
3 files changed
+11
-16
lines changed- lib/matplotlib/backends
3 files changed
+11
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
20 | 26 | | |
21 | 27 | | |
22 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 3 | + | |
8 | 4 | | |
9 | | - | |
10 | 5 | | |
11 | | - | |
| 6 | + | |
| 7 | + | |
12 | 8 | | |
13 | 9 | | |
14 | 10 | | |
| |||
32 | 28 | | |
33 | 29 | | |
34 | 30 | | |
35 | | - | |
36 | | - | |
37 | 31 | | |
38 | 32 | | |
39 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | 4 | | |
9 | | - | |
10 | 5 | | |
11 | 6 | | |
| 7 | + | |
| 8 | + | |
12 | 9 | | |
13 | 10 | | |
14 | 11 | | |
| |||
24 | 21 | | |
25 | 22 | | |
26 | 23 | | |
27 | | - | |
28 | | - | |
29 | 24 | | |
30 | 25 | | |
31 | 26 | | |
| |||
0 commit comments