Skip to content

Commit a59579b

Browse files
committed
Tighten input of normalize_bytes
1 parent 96cd466 commit a59579b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

eth/tools/_utils/normalization.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
Mapping,
1313
Sequence,
1414
Tuple,
15+
Union,
1516
)
1617

1718
from cytoolz import (
@@ -89,9 +90,9 @@ def normalize_int(value: IntConvertible) -> int:
8990
raise TypeError("Unsupported type: Got `{0}`".format(type(value)))
9091

9192

92-
def normalize_bytes(value: Any) -> bytes:
93+
def normalize_bytes(value: Union[bytes, str]) -> bytes:
9394
if is_bytes(value):
94-
return value
95+
return cast(bytes, value)
9596
elif is_text(value) and is_hex(value):
9697
return decode_hex(value)
9798
elif is_text(value):

0 commit comments

Comments
 (0)