Update src/wireviz/wireviz.py (#383)
Raising TypeError is better than assert. (Black reformatted) Co-authored-by: Andreas Motl <andreas.motl@panodata.org>
This commit is contained in:
parent
5cedba9def
commit
858b2664db
@ -88,9 +88,10 @@ def parse(
|
|||||||
raise Exception("No output formats or return types specified")
|
raise Exception("No output formats or return types specified")
|
||||||
|
|
||||||
yaml_data, yaml_file = _get_yaml_data_and_path(inp)
|
yaml_data, yaml_file = _get_yaml_data_and_path(inp)
|
||||||
assert isinstance(
|
if not isinstance(yaml_data, dict):
|
||||||
yaml_data, dict
|
raise TypeError(
|
||||||
), f"Expected a dict as top-level YAML input, but got: {type(yaml_data)}"
|
f"Expected a dict as top-level YAML input, but got: {type(yaml_data)}"
|
||||||
|
)
|
||||||
if output_formats:
|
if output_formats:
|
||||||
# need to write data to file, determine output directory and filename
|
# need to write data to file, determine output directory and filename
|
||||||
output_dir = _get_output_dir(yaml_file, output_dir)
|
output_dir = _get_output_dir(yaml_file, output_dir)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user