Simplifications

This commit is contained in:
Thomas Nagy 2018-05-19 11:30:05 +02:00
parent 6873a1b4c6
commit f78fbc32bb
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA
2 changed files with 3 additions and 16 deletions

View File

@ -311,11 +311,7 @@ def conf(f):
:type f: function
"""
def fun(*k, **kw):
mandatory = True
if 'mandatory' in kw:
mandatory = kw['mandatory']
del kw['mandatory']
mandatory = kw.pop('mandatory', True)
try:
return f(*k, **kw)
except Errors.ConfigurationError:

View File

@ -409,17 +409,8 @@ class Context(ctx):
kw['shell'] = isinstance(cmd, str)
self.log_command(cmd, kw)
if 'quiet' in kw:
quiet = kw['quiet']
del kw['quiet']
else:
quiet = None
if 'output' in kw:
to_ret = kw['output']
del kw['output']
else:
to_ret = STDOUT
quiet = kw.pop('quiet', None)
to_ret = kw.pop('output', STDOUT)
if Logs.verbose and not kw['shell'] and not Utils.check_exe(cmd[0]):
raise Errors.WafError('Program %r not found!' % cmd[0])