diff --git a/hub/kojihub.py b/hub/kojihub.py index 2df0b8b8..f3a9adb8 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -2418,8 +2418,10 @@ def _write_maven_repo_metadata(destdir, artifacts): # Sort the list so that the highest version number comes last. # group_id and artifact_id should be the same for all entries, # so we're really only comparing versions. - sort_param = {'key': functools.cmp_to_key(rpm.labelCompare)} if six.PY3 else \ - {'cmp': lambda a, b: rpm.labelCompare(a, b)} + if six.PY3: + sort_param = {'key': functools.cmp_to_key(rpm.labelCompare)} + else: + sort_param = {'cmp': lambda a, b: rpm.labelCompare(a, b)} artifacts = sorted(artifacts, **sort_param) artifactinfo = dict(zip(['group_id', 'artifact_id', 'version'], artifacts[-1])) artifactinfo['timestamp'] = datetime.datetime.now().strftime('%Y%m%d%H%M%S') diff --git a/www/kojiweb/index.py b/www/kojiweb/index.py index 5df0d2fe..6b6659e2 100644 --- a/www/kojiweb/index.py +++ b/www/kojiweb/index.py @@ -722,7 +722,7 @@ def canceltask(environ, taskID): _redirect(environ, 'taskinfo?taskID=%i' % taskID) def _sortByExtAndName(item): - """Sort filename tuples key funtion, first by extension, and then by name.""" + """Sort filename tuples key function, first by extension, and then by name.""" kRoot, kExt = os.path.splitext(os.path.basename(item[1])) return (kExt, kRoot)