Skip to content

Commit eb44ece

Browse files
Use rfind instead of index to find latest occurrance of usm_type in pickle bytes
1 parent b2bfe54 commit eb44ece

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dpctl/tests/test_sycl_usm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def test_pickling_reconstructor_invalid_type(memory_ctor):
201201
mobj = memory_ctor(1024, alignment=64)
202202
good_pickle_bytes = pickle.dumps(mobj)
203203
usm_types = expected_usm_type(memory_ctor).encode("utf-8")
204-
i = good_pickle_bytes.index(usm_types)
204+
i = good_pickle_bytes.rfind(usm_types)
205205
bad_pickle_bytes = good_pickle_bytes[:i] + b"u" + good_pickle_bytes[i + 1 :]
206206
with pytest.raises(ValueError):
207207
pickle.loads(bad_pickle_bytes)

0 commit comments

Comments
 (0)