Skip to content

Commit

Permalink
Drop Python 3.7 handling for pickle protocol 4 (#1132)
Browse files Browse the repository at this point in the history
Fixes #1131

Now that Python 3.8 is the minimum supported version, drop the special casing for Python 3.7's `HIGHEST_PROTOCOL`, which was 4 (not 5). In Python 3.8+, `HIGHEST_PROTOCOL >= 5`. So none of these branches are needed any more.

Authors:
  - https://github.com/jakirkham
  - Peter Andreas Entschev (https://github.com/pentschev)

Approvers:
  - Mads R. B. Kristensen (https://github.com/madsbk)
  - Peter Andreas Entschev (https://github.com/pentschev)

URL: #1132
  • Loading branch information
jakirkham committed Feb 28, 2023
1 parent 92190af commit 7c0bde1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions dask_cuda/tests/test_device_host_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
serialize,
serialize_bytelist,
)
from distributed.protocol.pickle import HIGHEST_PROTOCOL

from dask_cuda.device_host_file import DeviceHostFile, device_to_host, host_to_device

Expand Down Expand Up @@ -189,10 +188,7 @@ def test_serialize_cupy_collection(collection, length, value):

header, frames = serialize(obj, serializers=["pickle"], on_error="raise")

if HIGHEST_PROTOCOL >= 5:
assert len(frames) == (1 + len(obj.frames))
else:
assert len(frames) == 1
assert len(frames) == (1 + len(obj.frames))

obj2 = deserialize(header, frames)
res = host_to_device(obj2)
Expand Down

0 comments on commit 7c0bde1

Please sign in to comment.