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 8320913888F for ; Tue, 6 Oct 2015 06:13:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E33D7E086A; Tue, 6 Oct 2015 06:13:06 +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 6D8FEE086A for ; Tue, 6 Oct 2015 06:13:06 +0000 (UTC) Received: from professor-x (S010634bdfa9ecf80.vc.shawcable.net [96.49.31.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dolsen) by smtp.gentoo.org (Postfix) with ESMTPSA id 23B3334091E for ; Tue, 6 Oct 2015 06:13:04 +0000 (UTC) Date: Mon, 5 Oct 2015 23:12:15 -0700 From: Brian Dolbec To: gentoo-catalyst@lists.gentoo.org Subject: Re: [gentoo-catalyst] [PATCH] lint: clean up global statement warnings Message-ID: <20151005231215.778f2cd7.dolsen@gentoo.org> In-Reply-To: <1444104995-16709-1-git-send-email-vapier@gentoo.org> References: <1444104995-16709-1-git-send-email-vapier@gentoo.org> Organization: Gentoo Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archives-Salt: 7df1490b-d6cb-4322-90fe-c4cb83cedfa1 X-Archives-Hash: 58779a3287a6374d61cb3dc22116d348 On Tue, 6 Oct 2015 00:16:35 -0400 Mike Frysinger wrote: > Delete unused calls and add disables for the ones we actively want. > We generally want to avoid calls to "global" so force people to > disable the warning whenever they try to use it. > --- > catalyst/support.py | 2 -- > catalyst/version.py | 2 ++ > setup.py | 3 ++- > 3 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/catalyst/support.py b/catalyst/support.py > index a879eaf..1e3eeef 100644 > --- a/catalyst/support.py > +++ b/catalyst/support.py > @@ -294,8 +294,6 @@ def ismount(path): > > def addl_arg_parse(myspec,addlargs,requiredspec,validspec): > "helper function to help targets parse additional arguments" > - global valid_config_file_values > - > messages = [] > for x in addlargs.keys(): > if x not in validspec and x not in > valid_config_file_values and x not in requiredspec: diff --git > a/catalyst/version.py b/catalyst/version.py index d5c5cde..5deb4d7 > 100644 --- a/catalyst/version.py > +++ b/catalyst/version.py > @@ -18,6 +18,7 @@ _ver = None > > def get_git_version(version=__version__): > """Return: a string describing our version.""" > + # pylint: disable=global-statement > global _ver > cwd = os.path.dirname(os.path.abspath(__file__)) > version_info = get_ver(cwd) > @@ -39,6 +40,7 @@ def get_version(reset=False): > '''Returns a saved release version string or the > generated git release version. > ''' > + # pylint: disable=global-statement > global __version__, _ver > if _ver and not reset: > return _ver > diff --git a/setup.py b/setup.py > index 27ed2de..e4569ee 100755 > --- a/setup.py > +++ b/setup.py > @@ -55,7 +55,6 @@ _data_files.extend(_files('share/catalyst/targets', > 'targets')) class set_version(_Command): > '''Saves the specified release version information > ''' > - global __version__ > description = "hardcode script's version using VERSION from > environment" user_options = [] # [(long_name, short_name, desc),] > > @@ -66,6 +65,8 @@ class set_version(_Command): > pass > > def run(self): > + # pylint: disable=global-statement > + global __version__ > try: > version = _os.environ['VERSION'] > except KeyError: yes, :) looks good -- Brian Dolbec