On Mon,  5 Oct 2015 23:48:02 -0400
Mike Frysinger <[email protected]> wrote:

> By using a kwarg default of {}, the value is retained across multiple
> calls (and the linter warns about it).  Use the standard "if None"
> style to avoid that.
> 
> Also fix the write to the dict passed in by creating a local copy
> before we insert BASH_ENV into it.
> ---
>  catalyst/support.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/catalyst/support.py b/catalyst/support.py
> index b6705c9..78942a7 100644
> --- a/catalyst/support.py
> +++ b/catalyst/support.py
> @@ -120,11 +120,14 @@ def find_binary(myc):
>       return None
>  
>  
> -def cmd(mycmd, myexc="", env={}, debug=False, fail_func=None):
> +def cmd(mycmd, myexc="", env=None, debug=False, fail_func=None):
> +     if env is None:
> +             env = {}
>       #print "***** cmd()"
>       sys.stdout.flush()
>       args=[BASH_BINARY]
>       if "BASH_ENV" not in env:
> +             env = env.copy()
>               env["BASH_ENV"] =
> "/etc/spork/is/not/valid/profile.env" if debug:
>               args.append("-x")


How the hell did I miss that one, I've worked on this function a few
times.

Please merge :)
-- 
Brian Dolbec <dolsen>


Reply via email to