diff --git a/lark/exceptions.py b/lark/exceptions.py index 7a331ad..2660e35 100644 --- a/lark/exceptions.py +++ b/lark/exceptions.py @@ -1,6 +1,5 @@ from .utils import logger, NO_VALUE -from typing import Dict, Iterable, Callable, Union, TypeVar, Tuple, Any, List, Set, Optional, TYPE_CHECKING -from collections.abc import Sequence +from typing import Dict, Iterable, Callable, Union, TypeVar, Tuple, Any, List, Set, Optional, Collection, TYPE_CHECKING if TYPE_CHECKING: from .lexer import Token @@ -17,7 +16,7 @@ class ConfigurationError(LarkError, ValueError): pass -def assert_config(value, options: Sequence, msg='Got %r, expected one of %s'): +def assert_config(value, options: Collection, msg='Got %r, expected one of %s'): if value not in options: raise ConfigurationError(msg % (value, options)) diff --git a/lark/utils.py b/lark/utils.py index 2b6e3b6..ffaa593 100644 --- a/lark/utils.py +++ b/lark/utils.py @@ -241,7 +241,7 @@ def combine_alternatives(lists): try: import atomicwrites except ImportError: - atomicwrites = None + atomicwrites = None # type: ignore class FS: exists = os.path.exists