parent
a4ae298162
commit
59f7f8642a
3 changed files with 10 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
2
setup.py
2
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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue