From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 667FD138BED for ; Tue, 6 Oct 2015 13:46:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 294AAE086A; Tue, 6 Oct 2015 13:46:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B4571E086A for ; Tue, 6 Oct 2015 13:46:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8AC4A340B0B for ; Tue, 6 Oct 2015 13:46:22 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6AE53AB7 for ; Tue, 6 Oct 2015 13:46:18 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1444102021.ecbe93c9794d714e6fb05f3c06a30699667371fd.vapier@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/support.py X-VCS-Directories: catalyst/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: ecbe93c9794d714e6fb05f3c06a30699667371fd X-VCS-Branch: master Date: Tue, 6 Oct 2015 13:46:18 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 876ee360-5feb-4aa3-a8dd-f73dab38f6a2 X-Archives-Hash: b2590a492ae3844b6df356ddf7084ff2 commit: ecbe93c9794d714e6fb05f3c06a30699667371fd Author: Mike Frysinger gentoo org> AuthorDate: Tue Oct 6 03:27:01 2015 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Tue Oct 6 03:27:01 2015 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=ecbe93c9 lint: fix bad env dict handling 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")