Skip to content

Commit 6792027

Browse files
Update method_formatters.py
1 parent f4eb3c6 commit 6792027

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

web3/_utils/method_formatters.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ def type_aware_apply_formatters_to_dict(
161161
"""
162162
Preserve ``AttributeDict`` types if original ``value`` was an ``AttributeDict``.
163163
"""
164-
formatted_dict: Dict[str, Any] = apply_formatters_to_dict(formatters, dict(value))
165-
return (
166-
AttributeDict.recursive(formatted_dict)
167-
if is_attrdict(value)
168-
else formatted_dict
169-
)
164+
formatted_dict: Dict[str, Any]
165+
if is_attrdict(value):
166+
formatted_dict = apply_formatters_to_dict(formatters, dict(value))
167+
return AttributeDict.recursive(formatted_dict)
168+
else:
169+
return apply_formatters_to_dict(formatters, value)
170170

171171

172172
def type_aware_apply_formatters_to_dict_keys_and_values(

0 commit comments

Comments
 (0)