Skip to content

Commit

Permalink
Capture pickle.HIGHEST_PROTOCOL on each machine
Browse files Browse the repository at this point in the history
  • Loading branch information
mrocklin committed Aug 5, 2020
1 parent a997410 commit e0d57a1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions distributed/comm/tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from .utils import to_frames, from_frames, get_tcp_server_address, ensure_concrete_host
from ..protocol.compression import default_compression
from ..protocol.utils import msgpack_opts
from ..protocol import pickle


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -590,15 +591,12 @@ def handshake_info():
return {
"compression": default_compression,
"python": tuple(sys.version_info)[:3],
"pickle-protocol": pickle.HIGHEST_PROTOCOL,
}


def handshake_configuration(local, remote):
out = {}
if local["python"] >= (3, 8) and remote["python"] >= (3, 8):
out["pickle_protocol"] = 5
else:
out["pickle_protocol"] = 4
out = {"pickle-protocol": min(local["pickle-protocol"], remote["pickle-protocol"])}

if local["compression"] == remote["compression"]:
out["compression"] = local["compression"]
Expand Down

0 comments on commit e0d57a1

Please sign in to comment.