fix a few errors revealed by pylint

This commit is contained in:
Mike Bonnet 2014-10-21 14:51:06 -04:00 committed by Mike McLean
parent 1e8b7211ee
commit 7a6544a53d
2 changed files with 4 additions and 3 deletions

View file

@ -31,7 +31,6 @@ try:
import ast import ast
except ImportError: except ImportError:
ast = None ast = None
pass
import ConfigParser import ConfigParser
import base64 import base64
import errno import errno
@ -5202,7 +5201,7 @@ def _build_image_indirection(options, task_opts, session, args):
tmp_target = session.getBuildTarget(task_opts.target) tmp_target = session.getBuildTarget(task_opts.target)
if not tmp_target: if not tmp_target:
raise koji.GenericError, _("Unknown build target: %s" % target) raise koji.GenericError, _("Unknown build target: %s" % tmp_target)
dest_tag = session.getTag(tmp_target['dest_tag']) dest_tag = session.getTag(tmp_target['dest_tag'])
if not dest_tag: if not dest_tag:
raise koji.GenericError, _("Unknown destination tag: %s" % raise koji.GenericError, _("Unknown destination tag: %s" %

View file

@ -142,8 +142,10 @@ def dslice_ex(dict, keys, strict=True):
del ret[key] del ret[key]
return ret return ret
def call_with_argcheck(func, args, kwargs={}): def call_with_argcheck(func, args, kwargs=None):
"""Call function, raising ParameterError if args do not match""" """Call function, raising ParameterError if args do not match"""
if kwargs is None:
kwargs = {}
try: try:
return func(*args, **kwargs) return func(*args, **kwargs)
except TypeError, e: except TypeError, e: