Commit e415ed1
committed
Fix unpickling of CallbackRegistry on Py2.
In general, callbacks may not be pickled; thus, we simply recreate an
empty dictionary at unpickling. In order to ensure that `__setstate__`
(which just defers to `__init__`) is called, `__getstate__` must
return a truthy value (for pickle protocol>=3, i.e. Py3, the
*actual* behavior is that `__setstate__` will be called as long as
`__getstate__` does not return `None`, but this is undocumented -- see
http://bugs.python.org/issue12290).1 parent 194afed commit e415ed1Copy full SHA for e415ed1
File tree
Expand file treeCollapse file tree
2 files changed
+14
-4
lines changedOpen diff view settings
Filter options
- lib/matplotlib
- tests
Expand file treeCollapse file tree
2 files changed
+14
-4
lines changedOpen diff view settings
Collapse file
+9-4Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
502 | 502 | |
503 | 503 | |
504 | 504 | |
| 505 | + |
| 506 | + |
| 507 | + |
| 508 | + |
| 509 | + |
| 510 | + |
| 511 | + |
| 512 | + |
505 | 513 | |
506 | | - |
507 | | - |
508 | | - |
| 514 | + |
509 | 515 | |
510 | 516 | |
511 | | - |
512 | 517 | |
513 | 518 | |
514 | 519 | |
|
Collapse file
lib/matplotlib/tests/test_cbook.py
Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_cbook.py+5Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
3 | 3 | |
| 4 | + |
4 | 5 | |
5 | 6 | |
6 | 7 | |
| ||
283 | 284 | |
284 | 285 | |
285 | 286 | |
| 287 | + |
| 288 | + |
| 289 | + |
| 290 | + |
286 | 291 | |
287 | 292 | |
288 | 293 | |
|
0 commit comments