Skip to content

Commit

Permalink
TST fix test for cloudpickle <= 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
pierreglaser committed Mar 27, 2019
1 parent a34c11c commit 33bb384
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/cloudpickle_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,11 @@ def f():
# some setup is required to allow pytest apimodules to be correctly
# serializable.
from cloudpickle import CloudPickler
CloudPickler.dispatch[type(py.builtin)] = cloudpickle.module_reduce
if sys.version_info[:2] >= (3, 8):
CloudPickler.dispatch[type(py.builtin)] = cloudpickle.module_reduce
else:
CloudPickler.dispatch[type(py.builtin)] = CloudPickler.save_module

g = cloudpickle.loads(cloudpickle.dumps(f, protocol=self.protocol))

result = g()
Expand Down

0 comments on commit 33bb384

Please sign in to comment.