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 09D5613888F for ; Tue, 6 Oct 2015 06:37:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 77FCBE07D9; Tue, 6 Oct 2015 06:37:49 +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 EBF90E07D9 for ; Tue, 6 Oct 2015 06:37:48 +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 CA2BC3409C7 for ; Tue, 6 Oct 2015 06:37:47 +0000 (UTC) Date: Mon, 5 Oct 2015 23:36:58 -0700 From: Brian Dolbec To: gentoo-catalyst@lists.gentoo.org Subject: Re: [gentoo-catalyst] [PATCH] lint: fix up unused variables Message-ID: <20151005233658.37bb76f8.dolsen@gentoo.org> In-Reply-To: <1444104393-16018-1-git-send-email-vapier@gentoo.org> References: <1444104393-16018-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: 808e3144-c5a8-44c9-ac7d-9a485ce80db9 X-Archives-Hash: efd75c5a7c5c1bb978357ce3d3a678ea On Tue, 6 Oct 2015 00:06:33 -0400 Mike Frysinger wrote: > This variables aren't actually used which the linter likes to warn > about, so add a _ prefix to their name to silence the warnings. > --- > catalyst/base/resume.py | 2 +- > catalyst/main.py | 2 +- > catalyst/support.py | 2 +- > catalyst/targets/netboot.py | 5 +++-- > setup.py | 2 +- > 5 files changed, 7 insertions(+), 6 deletions(-) > > diff --git a/catalyst/base/resume.py b/catalyst/base/resume.py > index 608f574..e3f03e7 100644 > --- a/catalyst/base/resume.py > +++ b/catalyst/base/resume.py > @@ -23,7 +23,7 @@ class AutoResumeError(Exception): > def __init__(self, message, print_traceback=False): > if message: > if print_traceback: > - (type,value)=sys.exc_info()[:2] > + (_type, value) = sys.exc_info()[:2] > if value!=None: > print > print "Traceback values > found. listing..." diff --git a/catalyst/main.py b/catalyst/main.py > index dfa0609..04f689e 100644 > --- a/catalyst/main.py > +++ b/catalyst/main.py > @@ -182,7 +182,7 @@ def main(): > > # parse out the command line arguments > try: > - opts,args = getopt.getopt(sys.argv[1:], > "apPThvdc:C:f:FVs:", ["purge", "purgeonly", "purgetmponly", "help", > "version", "debug",\ > + opts, _args = getopt.getopt(sys.argv[1:], > "apPThvdc:C:f:FVs:", ["purge", "purgeonly", "purgetmponly", "help", > "version", "debug", "clear-autoresume", "config=", "cli=", "file=", > "fetch", "verbose","snapshot="]) except getopt.GetoptError: > diff --git a/catalyst/support.py b/catalyst/support.py > index 5563a15..a879eaf 100644 > --- a/catalyst/support.py > +++ b/catalyst/support.py > @@ -88,7 +88,7 @@ class CatalystError(Exception): > def __init__(self, message, print_traceback=False): > if message: > if print_traceback: > - (type,value)=sys.exc_info()[:2] > + (_type, value) = sys.exc_info()[:2] > if value!=None: > print > print "Traceback values > found. listing..." diff --git a/catalyst/targets/netboot.py > b/catalyst/targets/netboot.py index c41ed59..b0e322c 100644 > --- a/catalyst/targets/netboot.py > +++ b/catalyst/targets/netboot.py > @@ -31,11 +31,12 @@ class netboot(StageBase): > self.required_values=[] > > try: > + # XXX: This code does nothing because the > for loop below is disabled. if "netboot/packages" in addlargs: > if > type(addlargs["netboot/packages"]) == types.StringType: > - > loopy=[addlargs["netboot/packages"]] > + _loopy = > [addlargs["netboot/packages"]] else: > - > loopy=addlargs["netboot/packages"] > + _loopy = > addlargs["netboot/packages"] > # for x in loopy: > # > self.required_values.append("netboot/packages/"+x+"/files") diff > --git a/setup.py b/setup.py index feca894..27ed2de 100755 > --- a/setup.py > +++ b/setup.py > @@ -34,7 +34,7 @@ def _files(prefix, root): > > Yielding `(target_dir, (file_source_paths, ...))` tuples. > """ > - for dirpath, dirnames, filenames in _os.walk(root): > + for dirpath, _dirnames, filenames in _os.walk(root): > reldir = _os.path.relpath(dirpath, root) > install_directory = _posix_path( > _os.path.join(prefix, reldir)) good :) -- Brian Dolbec