diff --git a/webviz_config/_config_parser.py b/webviz_config/_config_parser.py index 20483767..a1d77cb3 100644 --- a/webviz_config/_config_parser.py +++ b/webviz_config/_config_parser.py @@ -233,10 +233,12 @@ def __init__(self, yaml_file: pathlib.Path): f"There is something wrong in the configuration file {yaml_file}. " ) - if hasattr(excep, "problem_mark"): + # Looking forward to only supporting Python 3.8+ and PEP572... + problem_mark = getattr(excep, "problem_mark", None) + if problem_mark is not None: extra_info += ( "The typo is probably somewhere around " - f"line {excep.problem_mark.line + 1}." + f"line {problem_mark.line + 1}." ) raise type(excep)(