Skip to content

Commit

Permalink
handle path=None
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Nov 16, 2024
1 parent a460624 commit 7b93c2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dargs/dargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,14 @@ def _traverse_sub(
variant_hook: HookVrntType = _DUMMYHOOK,
path: list[str] | None = None,
):
if path is None:
path = [self.name]
if not isinstance(value, dict):
raise ArgumentTypeError(
path,
f"key `{path[-1]}` gets wrong value type, "
f"requires dict but {type(value).__name__} is given",
)
if path is None:
path = [self.name]
sub_hook(self, value, path)
for subvrnt in self.sub_variants.values():
variant_hook(subvrnt, value, path)
Expand Down

0 comments on commit 7b93c2a

Please sign in to comment.