Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions manim/utils/hashing.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ def _iter_check_list(lst):
# We have to make a copy, as we don't want to touch to the original list
# A deepcopy isn't necessary as it is already recursive.
lst_copy = copy.copy(lst)
if isinstance(lst, tuple):
# NOTE: Sometimes a tuple can pass through this function. As a tuple
# is immutable, we convert it to a list to be able to modify it.
# It's ok as it is a copy.
lst_copy = list(lst_copy)
for i, el in enumerate(lst):
if not isinstance(lst, tuple):
lst_copy[i] = self._handle_already_processed(
Expand Down
6 changes: 6 additions & 0 deletions tests/test_hashing.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,9 @@ def test_JSON_with_big_np_array():
a = np.zeros((1000, 1000))
o_ser = hashing.get_json(a)
assert "TRUNCATED ARRAY" in o_ser


def test_JSON_with_tuple():
o = [(1, [1])]
o_ser = hashing.get_json(o)
assert o_ser == "[[1, [1]]]"