From a8900c13b71f44ac27f7441203ce96461a7c553f Mon Sep 17 00:00:00 2001 From: Erez Sh Date: Tue, 17 Aug 2021 14:59:30 +0300 Subject: [PATCH] Changed sequence to collection --- lark/exceptions.py | 5 ++--- lark/utils.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) 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