Skip to content

Commit 1d2fbf5

Browse files
committed
Coerce buffer to bytes only when it is needed
1 parent 98e28b8 commit 1d2fbf5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

numcodecs/tests/common.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,6 @@ def check_backwards_compatibility(codec_id, arrays, codecs, precision=None, pref
187187
# setup
188188
i = int(arr_fn.split('.')[-2])
189189
arr = np.load(arr_fn)
190-
if arr.dtype.kind is not 'O':
191-
arr_bytes = buffer_tobytes(arr)
192190
if arr.flags.f_contiguous:
193191
order = 'F'
194192
else:
@@ -234,7 +232,7 @@ def check_backwards_compatibility(codec_id, arrays, codecs, precision=None, pref
234232
assert_array_items_equal(arr, dec_arr)
235233
else:
236234
assert_array_equal(arr, dec_arr)
237-
assert arr_bytes == buffer_tobytes(dec)
235+
assert buffer_tobytes(arr) == buffer_tobytes(dec)
238236

239237

240238
def check_err_decode_object_buffer(compressor):

0 commit comments

Comments
 (0)