Skip to content

Commit ba0d358

Browse files
Update method_formatters.py
1 parent 6792027 commit ba0d358

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]
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)
164+
formatted_dict: Dict[str, Any] = apply_formatters_to_dict(formatters, value)
165+
return (
166+
AttributeDict.recursive(formatted_dict)
167+
if is_attrdict(value)
168+
else formatted_dict
169+
)
170170

171171

172172
def type_aware_apply_formatters_to_dict_keys_and_values(

0 commit comments

Comments
 (0)