fix: Typing in the parser factory
This commit is contained in:
parent
8b41764a3e
commit
6061f47231
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user