Skip to content

Commit

Permalink
Fix latest mypy warning (#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-kiaer authored Jun 18, 2021
1 parent da05914 commit ccc6960
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions webviz_config/_config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)(
Expand Down

0 comments on commit ccc6960

Please sign in to comment.