[PATCH 2/7] fix useless-else-on-loop warnings #pylint
Mike McLean
mikem at redhat.com
Wed May 13 21:25:43 UTC 2015
---
hub/kojihub.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/hub/kojihub.py b/hub/kojihub.py
index 0fa33e0..3da3dc8 100644
--- a/hub/kojihub.py
+++ b/hub/kojihub.py
@@ -3896,8 +3896,8 @@ def get_archive_file(archive_id, filename):
for file_info in files:
if file_info['name'] == filename:
return file_info
- else:
- return None
+ #otherwise
+ return None
def list_task_output(taskID, stat=False):
"""List the files generated by the task with the given ID. This
@@ -4875,11 +4875,11 @@ def get_archive_type(filename=None, type_name=None, type_id=None, strict=False):
elif len(results) > 1:
# this should never happen, and is a misconfiguration in the database
raise koji.GenericError, 'multiple matches for file extension: %s' % ext
+ #otherwise
+ if strict:
+ raise koji.GenericError, 'unsupported file extension: %s' % ext
else:
- if strict:
- raise koji.GenericError, 'unsupported file extension: %s' % ext
- else:
- return None
+ return None
def new_maven_build(build, maven_info):
"""
--
1.9.3
More information about the buildsys
mailing list