Commit cb72c42
committed
wx.App() should be init'ed in new_figure_manager_given_figure
... not in new_figure_manager. Otherwise, unpickling a figure fails
with wx if no figure was created previously:
```
$ MPLBACKEND=wxagg python -c 'from pylab import *; plot(); import pickle; pickle.dump(plt.gcf(), open("/tmp/pkl", "wb"))'
$ MPLBACKEND=wxagg python -c 'import pickle; pickle.load(open("/tmp/pkl", "rb"))'
```
fails with "wx._core.PyNoAppError: The wx.App object must be created first!"
Because new_figure_manager calls new_figure_manager_given_figure (see
note in backend_template), it doesn't need to copy the instantiation.
Also note that backend_tk was already doing the init in
new_figure_manager_given_figure.1 parent f0593a6 commit cb72c42
2 files changed
+6
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | 161 | | |
167 | 162 | | |
168 | 163 | | |
169 | 164 | | |
170 | 165 | | |
171 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1356 | 1356 | | |
1357 | 1357 | | |
1358 | 1358 | | |
1359 | | - | |
| 1359 | + | |
1360 | 1360 | | |
1361 | 1361 | | |
1362 | 1362 | | |
| |||
1366 | 1366 | | |
1367 | 1367 | | |
1368 | 1368 | | |
1369 | | - | |
1370 | | - | |
1371 | | - | |
1372 | | - | |
1373 | 1369 | | |
1374 | 1370 | | |
1375 | 1371 | | |
| |||
0 commit comments