Skip to content

Commit 5881e72

Browse files
authored
Merge pull request #7854 from ahcub/master
FIX for _rrule maximum recursion depth exceeded on multiprocessing usage
2 parents 4c5fca7 + 17ba26c commit 5881e72

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lib/matplotlib/dates.py

+2
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,8 @@ def set(self, **kwargs):
711711
self._rrule = rrule(**self._construct)
712712

713713
def __getattr__(self, name):
714+
if name in ['__getstate__', '__setstate__']:
715+
return object.__getattr__(self, name)
714716
if name in self.__dict__:
715717
return self.__dict__[name]
716718
return getattr(self._rrule, name)

lib/matplotlib/tests/test_pickle.py

+10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import numpy as np
1212

1313
from matplotlib.testing.decorators import cleanup, image_comparison
14+
from matplotlib.dates import rrulewrapper
1415
import matplotlib.pyplot as plt
1516
import matplotlib.transforms as mtransforms
1617

@@ -270,6 +271,15 @@ def test_transform():
270271
assert_equal(obj.wrapper.output_dims, obj.composite.output_dims)
271272

272273

274+
def test_rrulewrapper():
275+
r = rrulewrapper(2)
276+
try:
277+
pickle.loads(pickle.dumps(r))
278+
except RecursionError:
279+
print('rrulewrapper pickling test failed')
280+
raise
281+
282+
273283
if __name__ == '__main__':
274284
import nose
275285
nose.runmodule(argv=['-s'])

0 commit comments

Comments
 (0)