Skip to content

Commit

Permalink
Update src/wireviz/wireviz.py
Browse files Browse the repository at this point in the history
Raising TypeError is better than assert. (Black reformatted)

Co-authored-by: Andreas Motl <[email protected]>
  • Loading branch information
kvid and amotl committed Jun 14, 2024
1 parent fbe3ef8 commit 9f80e73
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/wireviz/wireviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ def parse(
raise Exception("No output formats or return types specified")

yaml_data, yaml_file = _get_yaml_data_and_path(inp)
assert isinstance(
yaml_data, dict
), f"Expected a dict as top-level YAML input, but got: {type(yaml_data)}"
if not isinstance(yaml_data, dict):
raise TypeError(
f"Expected a dict as top-level YAML input, but got: {type(yaml_data)}"
)
if output_formats:
# need to write data to file, determine output directory and filename
output_dir = _get_output_dir(yaml_file, output_dir)
Expand Down

0 comments on commit 9f80e73

Please sign in to comment.