Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkeye217 committed Dec 18, 2024
1 parent 69e4992 commit a4d1aab
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions frigate/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import signal
import sys
import threading
from typing import Union

import ruamel.yaml
from pydantic import ValidationError
Expand Down Expand Up @@ -61,12 +62,15 @@ def main() -> None:

try:
for i, part in enumerate(error_path):
key = int(part) if part.isdigit() else part
key: Union[int, str] = (
int(part) if isinstance(part, str) and part.isdigit() else part
)

if isinstance(current, ruamel.yaml.comments.CommentedMap):
current = current[key]
elif isinstance(current, list):
current = current[key]
if isinstance(key, int):
current = current[key]

if hasattr(current, "lc"):
last_line_number = current.lc.line
Expand Down

0 comments on commit a4d1aab

Please sign in to comment.