From cf0bcd3993ef7efd2fa058ec5aee7723c42ed402 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 6 Dec 2023 22:41:53 -0500 Subject: [PATCH 1/2] remove `list` support from `convert_atom_to_bytes()` --- clvm/SExp.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/clvm/SExp.py b/clvm/SExp.py index 9901849c..c368a2c7 100644 --- a/clvm/SExp.py +++ b/clvm/SExp.py @@ -36,7 +36,7 @@ def looks_like_clvm_object(o: typing.Any) -> bool: # this function recognizes some common types and turns them into plain bytes, def convert_atom_to_bytes( - v: typing.Union[bytes, str, int, None, list], + v: typing.Union[bytes, str, int, None], ) -> bytes: if isinstance(v, bytes): @@ -47,8 +47,6 @@ def convert_atom_to_bytes( return int_to_bytes(v) if v is None: return b"" - if v == []: - return b"" if hasattr(v, "__bytes__"): return bytes(v) From 50856db559c54b8e55ee1f33cf16a64334937f78 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Thu, 7 Dec 2023 10:40:57 -0500 Subject: [PATCH 2/2] remove associated test --- tests/to_sexp_test.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/to_sexp_test.py b/tests/to_sexp_test.py index 92258ad9..73787a8f 100644 --- a/tests/to_sexp_test.py +++ b/tests/to_sexp_test.py @@ -163,7 +163,6 @@ def test_convert_atom(self): assert convert_atom_to_bytes(b"foobar") == b"foobar" assert convert_atom_to_bytes(None) == b"" - assert convert_atom_to_bytes([]) == b"" assert convert_atom_to_bytes(DummyByteConvertible()) == b"foobar"