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 | |
parent | equery: reformat with black (diff) | |
download | gentoolkit-1a2c70dd32ab335b38fa6da8a625ff47a3467dfa.tar.gz gentoolkit-1a2c70dd32ab335b38fa6da8a625ff47a3467dfa.tar.bz2 gentoolkit-1a2c70dd32ab335b38fa6da8a625ff47a3467dfa.zip |
Run `pyupgrade --py39-plus`
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/epkginfo | 2 | ||||
-rwxr-xr-x | bin/eshowkw | 1 | ||||
-rwxr-xr-x | bin/merge-driver-ekeyword | 11 |
3 files changed, 7 insertions, 7 deletions
diff --git a/bin/epkginfo b/bin/epkginfo index 4cb483e..29c4c4d 100755 --- a/bin/epkginfo +++ b/bin/epkginfo @@ -28,7 +28,7 @@ def print_epkginfo_help(): equery.initialize_configuration() args = sys.argv[1:] -if not args or set(('-h', '--help')).intersection(args): +if not args or {'-h', '--help'}.intersection(args): print_epkginfo_help() else: try: diff --git a/bin/eshowkw b/bin/eshowkw index 0ef4dda..d32ba6c 100755 --- a/bin/eshowkw +++ b/bin/eshowkw @@ -1,5 +1,4 @@ #!/usr/bin/python -# vim:fileencoding=utf-8 # Copyright 2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 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) |