Skip to content

Commit

Permalink
fix(client): properly handle optional file params (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored and cleb11 committed Sep 12, 2023
1 parent 845f8e3 commit 2ff8b1e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/modern_treasury/_utils/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ def _extract_items(
path: Sequence[str],
*,
index: int,
# TODO: rename
flattened_key: str | None,
) -> list[tuple[str, FileTypes]]:
try:
key = path[index]
except IndexError:
if isinstance(obj, NotGiven):
# no value was provided - we can safely ignore
return []

# We have exhausted the path, return the entry we found.
if not isinstance(obj, bytes) and not isinstance(obj, tuple):
raise RuntimeError(
Expand Down

0 comments on commit 2ff8b1e

Please sign in to comment.