Skip to content

Commit 0efab69

Browse files
committed
Remove removing support for py 3.8
1 parent ea7cef3 commit 0efab69

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

python/cucumber_expressions/argument.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Optional, List
3+
from typing import Optional, List, Tuple
44

55
from cucumber_expressions.parameter_type import ParameterType
66
from cucumber_expressions.tree_regexp import TreeRegexp, Group
@@ -19,7 +19,7 @@ def __init__(
1919
def build(
2020
tree_regexp: TreeRegexp,
2121
text: str,
22-
parameter_types_and_names: List[tuple[ParameterType, Optional[str]]],
22+
parameter_types_and_names: List[Tuple[ParameterType, Optional[str]]],
2323
) -> Optional[List[Argument]]:
2424
# Check if all elements in parameter_types_and_names are tuples
2525
for item in parameter_types_and_names:

python/cucumber_expressions/expression.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Optional, List
1+
from typing import Optional, List, Tuple
22

33
from cucumber_expressions.argument import Argument
44
from cucumber_expressions.ast import Node, NodeType
@@ -22,7 +22,7 @@ class CucumberExpression:
2222
def __init__(self, expression: str, parameter_type_registry: ParameterTypeRegistry):
2323
self.expression = expression
2424
self.parameter_type_registry = parameter_type_registry
25-
self.parameter_types_and_names: List[tuple[ParameterType, Optional[str]]] = []
25+
self.parameter_types_and_names: List[Tuple[ParameterType, Optional[str]]] = []
2626
self.tree_regexp = TreeRegexp(
2727
self.rewrite_to_regex(CucumberExpressionParser().parse(self.expression))
2828
)
@@ -102,7 +102,7 @@ def rewrite_parameter(self, node: Node) -> str:
102102

103103
def parse_parameter_name(
104104
self, name: str
105-
) -> tuple[Optional[str], Optional[ParameterType]]:
105+
) -> Tuple[Optional[str], Optional[ParameterType]]:
106106
"""Helper function to parse the parameter name and return group_name and parameter_type."""
107107
if ":" in name:
108108
group_name, parameter_type_name = name.split(":")

python/cucumber_expressions/expression_parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import NamedTuple, Optional, Callable, List
3+
from typing import NamedTuple, Optional, Callable, List, Tuple, Union
44

55
from cucumber_expressions.ast import Token, TokenType, Node, NodeType
66
from cucumber_expressions.errors import (
@@ -171,7 +171,7 @@ def parse_between(
171171
begin_token: TokenType,
172172
end_token: TokenType,
173173
parsers: List,
174-
) -> Callable[[Parser], Result | tuple[int, Node]]:
174+
) -> Callable[[Parser], Union[Result, Tuple[int, Node]]]:
175175
def _parse_between(parser: Parser):
176176
if not self.looking_at(parser.tokens, parser.current, begin_token):
177177
return Result(0, None)
@@ -221,7 +221,7 @@ def parse_tokens_until(
221221
tokens: List[Token],
222222
start_at: int,
223223
end_tokens: List[TokenType],
224-
) -> tuple[int, List[Node]]:
224+
) -> Tuple[int, List[Node]]:
225225
current = start_at
226226
size = len(tokens)
227227
ast: List[Node] = []

python/cucumber_expressions/regular_expression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import re
22
from collections.abc import Generator
3-
from typing import Optional, Union
3+
from typing import Optional, Union, Tuple
44

55
from cucumber_expressions.argument import Argument
66
from cucumber_expressions.parameter_type import ParameterType
@@ -67,7 +67,7 @@ def _process_capture_group(self, group_source: str):
6767

6868
def generate_parameter_types(
6969
self, text
70-
) -> Generator[tuple[ParameterType, Optional[str]]]:
70+
) -> Generator[Tuple[ParameterType, Optional[str]]]:
7171
for group_builder in self.tree_regexp.group_builder.children:
7272
# Extract the raw source for the group
7373
parameter_type_regexp = group_builder.source

0 commit comments

Comments
 (0)