diff options
| author | Sam James <sam@gentoo.org> | 2023-08-07 01:29:39 +0100 |
|---|---|---|
| committer | Sam James <sam@gentoo.org> | 2023-08-07 01:32:33 +0100 |
| commit | 1a2c70dd32ab335b38fa6da8a625ff47a3467dfa (patch) | |
| tree | b280481bd8f8642dbc86b10e8726677bbdd28a24 /bin/merge-driver-ekeyword | |
| parent | 9fbd05c05f86bb9c67d229ea64fe72c5ea08cf62 (diff) | |
| download | gentoolkit-1a2c70dd32ab335b38fa6da8a625ff47a3467dfa.tar.gz | |
Run `pyupgrade --py39-plus`
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'bin/merge-driver-ekeyword')
| -rwxr-xr-x | bin/merge-driver-ekeyword | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/merge-driver-ekeyword b/bin/merge-driver-ekeyword index 73e0430..f75056c 100755 --- a/bin/merge-driver-ekeyword +++ b/bin/merge-driver-ekeyword @@ -14,15 +14,16 @@ import os import sys import tempfile -from typing import List, Optional, Sequence, Tuple +from typing import List, Optional, Tuple +from collections.abc import Sequence from gentoolkit.ekeyword import ekeyword -KeywordChanges = List[Tuple[Optional[List[str]], Optional[List[str]]]] +KeywordChanges = list[tuple[Optional[list[str]], Optional[list[str]]]] -def keyword_array(keyword_line: str) -> List[str]: +def keyword_array(keyword_line: str) -> list[str]: # Find indices of string inside the double-quotes i1: int = keyword_line.find('"') + 1 i2: int = keyword_line.rfind('"') @@ -32,8 +33,8 @@ def keyword_array(keyword_line: str) -> List[str]: def keyword_line_changes(old: str, new: str) -> KeywordChanges: - a: List[str] = keyword_array(old) - b: List[str] = keyword_array(new) + a: list[str] = keyword_array(old) + b: list[str] = keyword_array(new) s = difflib.SequenceMatcher(a=a, b=b) |
