Skip to content

Commit

Permalink
fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
minenwerfer committed Sep 10, 2024
1 parent bffcd0f commit 17bda52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/normalize_json/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def translate(
if err := check_types(node, value, modifiers):
raise ValueError('check_types @ %s (got "%s", expected "%s")' % (original_name, *err))

if node_enum := node.get('enum') and value != None:
if (node_enum := node.get('enum')) and value != None:
if node.get('array'):
if not isinstance(value, list):
raise TypeError()
Expand All @@ -272,7 +272,7 @@ def translate(
for v in typing.cast(list[str], value)
]
else:
value = typing.cast(dict[str, str], node_enum).get(typing.cast(typing.Any, value))
value = node_enum.get(typing.cast(typing.Any, value))

ret[original_name] = value

Expand Down

0 comments on commit 17bda52

Please sign in to comment.