mirror of https://gitlab.com/ita1024/waf.git
Simplifications
This commit is contained in:
parent
6873a1b4c6
commit
f78fbc32bb
|
@ -311,11 +311,7 @@ def conf(f):
|
||||||
:type f: function
|
:type f: function
|
||||||
"""
|
"""
|
||||||
def fun(*k, **kw):
|
def fun(*k, **kw):
|
||||||
mandatory = True
|
mandatory = kw.pop('mandatory', True)
|
||||||
if 'mandatory' in kw:
|
|
||||||
mandatory = kw['mandatory']
|
|
||||||
del kw['mandatory']
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return f(*k, **kw)
|
return f(*k, **kw)
|
||||||
except Errors.ConfigurationError:
|
except Errors.ConfigurationError:
|
||||||
|
|
|
@ -409,17 +409,8 @@ class Context(ctx):
|
||||||
kw['shell'] = isinstance(cmd, str)
|
kw['shell'] = isinstance(cmd, str)
|
||||||
self.log_command(cmd, kw)
|
self.log_command(cmd, kw)
|
||||||
|
|
||||||
if 'quiet' in kw:
|
quiet = kw.pop('quiet', None)
|
||||||
quiet = kw['quiet']
|
to_ret = kw.pop('output', STDOUT)
|
||||||
del kw['quiet']
|
|
||||||
else:
|
|
||||||
quiet = None
|
|
||||||
|
|
||||||
if 'output' in kw:
|
|
||||||
to_ret = kw['output']
|
|
||||||
del kw['output']
|
|
||||||
else:
|
|
||||||
to_ret = STDOUT
|
|
||||||
|
|
||||||
if Logs.verbose and not kw['shell'] and not Utils.check_exe(cmd[0]):
|
if Logs.verbose and not kw['shell'] and not Utils.check_exe(cmd[0]):
|
||||||
raise Errors.WafError('Program %r not found!' % cmd[0])
|
raise Errors.WafError('Program %r not found!' % cmd[0])
|
||||||
|
|
Loading…
Reference in New Issue