1
0
mirror of synced 2024-11-22 01:04:23 +01:00

fix: Typing in the parser factory

This commit is contained in:
Gu1nn3zz 2023-03-07 11:10:59 +01:00 committed by jvoisin
parent 8b41764a3e
commit 6061f47231

View File

@ -2,7 +2,7 @@ import glob
import os import os
import mimetypes import mimetypes
import importlib import importlib
from typing import TypeVar, Optional, List from typing import TypeVar, Optional, List, Tuple
from . import abstract, UNSUPPORTED_EXTENSIONS from . import abstract, UNSUPPORTED_EXTENSIONS
@ -42,7 +42,7 @@ def _get_parsers() -> List[T]:
return __get_parsers(abstract.AbstractParser) return __get_parsers(abstract.AbstractParser)
def get_parser(filename: str) -> tuple[Optional[T], Optional[str]]: def get_parser(filename: str) -> Tuple[Optional[T], Optional[str]]:
""" Return the appropriate parser for a given filename. """ Return the appropriate parser for a given filename.
:raises ValueError: Raised if the instantiation of the parser went wrong. :raises ValueError: Raised if the instantiation of the parser went wrong.