From 59f7f8642ab45866c80e0417369acb8ef7306a39 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Aug 29 2022 13:03:05 +0000 Subject: fix flake8 errors Related: https://pagure.io/koji/issue/3480 --- diff --git a/hub/kojihub.py b/hub/kojihub.py index 12d4f9f..5d793da 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -106,19 +106,19 @@ def convert_value(value, cast=None, message=None, """ if value is None: if not none_allowed: - raise(exc_type(message or f"Invalid type, expected type {cast}")) + raise exc_type(message or f"Invalid type, expected type {cast}") else: return value if check_only: if not isinstance(value, cast): - raise(exc_type(message or f"Invalid type for value '{value}': {type(value)}, " - f"expected type {cast}")) + raise exc_type(message or f"Invalid type for value '{value}': {type(value)}, " + f"expected type {cast}") else: try: value = cast(value) except (ValueError, TypeError): - raise(exc_type(message or f"Invalid type for value '{value}': {type(value)}, " - f"expected type {cast}")) + raise exc_type(message or f"Invalid type for value '{value}': {type(value)}, " + f"expected type {cast}") return value @@ -6957,7 +6957,7 @@ class CG_Importer(object): def match_kojifile(self, comp): """Look up the file by archive id and sanity check the other data""" - assert(comp['type'] == 'kojifile') + assert (comp['type'] == 'kojifile') archive = get_archive(comp['archive_id'], strict=True) build = get_build(archive['build_id'], strict=True) @@ -10044,7 +10044,7 @@ class BuildTagInheritsFromTest(koji.policy.BaseSimpleTest): def run(self, data): test_name, *args = self.str.split() - assert(test_name == self.name) + assert (test_name == self.name) for tinfo in policy_get_build_tags(data, taginfo=True): if tinfo is None: # content generator buildroots might not have tag info diff --git a/koji/util.py b/koji/util.py index 2e0e239..504e223 100644 --- a/koji/util.py +++ b/koji/util.py @@ -659,8 +659,8 @@ def check_sigmd5(filename): data = f.read(16) tag, data_type, offset, count = struct.unpack('!IIII', data) if tag == 1004: # SIGMD5 - assert(data_type == 7) # binary data - assert(count == 16) # 16 bytes of md5 + assert (data_type == 7) # binary data + assert (count == 16) # 16 bytes of md5 break # seek to location of md5 f.seek(o + 8 + indexcount * 16 + offset) diff --git a/setup.py b/setup.py index c965c8f..80790ef 100755 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def get_install_requires(): def get_version(): cwd = os.path.dirname(__file__) exec(open(os.path.join(cwd, 'koji/_version.py'), 'rt').read()) - return(locals()['__version__']) + return locals()['__version__'] def get_long_description():