Gentoo Archives: gentoo-catalyst

From: Mike Frysinger <vapier@g.o>
To: gentoo-catalyst@l.g.o
Subject: [gentoo-catalyst] [PATCH] lint: fix up unused variables
Date: Tue, 06 Oct 2015 04:06:39
Message-Id: 1444104393-16018-1-git-send-email-vapier@gentoo.org
1 This variables aren't actually used which the linter likes to warn about,
2 so add a _ prefix to their name to silence the warnings.
3 ---
4 catalyst/base/resume.py | 2 +-
5 catalyst/main.py | 2 +-
6 catalyst/support.py | 2 +-
7 catalyst/targets/netboot.py | 5 +++--
8 setup.py | 2 +-
9 5 files changed, 7 insertions(+), 6 deletions(-)
10
11 diff --git a/catalyst/base/resume.py b/catalyst/base/resume.py
12 index 608f574..e3f03e7 100644
13 --- a/catalyst/base/resume.py
14 +++ b/catalyst/base/resume.py
15 @@ -23,7 +23,7 @@ class AutoResumeError(Exception):
16 def __init__(self, message, print_traceback=False):
17 if message:
18 if print_traceback:
19 - (type,value)=sys.exc_info()[:2]
20 + (_type, value) = sys.exc_info()[:2]
21 if value!=None:
22 print
23 print "Traceback values found. listing..."
24 diff --git a/catalyst/main.py b/catalyst/main.py
25 index dfa0609..04f689e 100644
26 --- a/catalyst/main.py
27 +++ b/catalyst/main.py
28 @@ -182,7 +182,7 @@ def main():
29
30 # parse out the command line arguments
31 try:
32 - opts,args = getopt.getopt(sys.argv[1:], "apPThvdc:C:f:FVs:", ["purge", "purgeonly", "purgetmponly", "help", "version", "debug",\
33 + opts, _args = getopt.getopt(sys.argv[1:], "apPThvdc:C:f:FVs:", ["purge", "purgeonly", "purgetmponly", "help", "version", "debug",
34 "clear-autoresume", "config=", "cli=", "file=", "fetch", "verbose","snapshot="])
35
36 except getopt.GetoptError:
37 diff --git a/catalyst/support.py b/catalyst/support.py
38 index 5563a15..a879eaf 100644
39 --- a/catalyst/support.py
40 +++ b/catalyst/support.py
41 @@ -88,7 +88,7 @@ class CatalystError(Exception):
42 def __init__(self, message, print_traceback=False):
43 if message:
44 if print_traceback:
45 - (type,value)=sys.exc_info()[:2]
46 + (_type, value) = sys.exc_info()[:2]
47 if value!=None:
48 print
49 print "Traceback values found. listing..."
50 diff --git a/catalyst/targets/netboot.py b/catalyst/targets/netboot.py
51 index c41ed59..b0e322c 100644
52 --- a/catalyst/targets/netboot.py
53 +++ b/catalyst/targets/netboot.py
54 @@ -31,11 +31,12 @@ class netboot(StageBase):
55 self.required_values=[]
56
57 try:
58 + # XXX: This code does nothing because the for loop below is disabled.
59 if "netboot/packages" in addlargs:
60 if type(addlargs["netboot/packages"]) == types.StringType:
61 - loopy=[addlargs["netboot/packages"]]
62 + _loopy = [addlargs["netboot/packages"]]
63 else:
64 - loopy=addlargs["netboot/packages"]
65 + _loopy = addlargs["netboot/packages"]
66
67 # for x in loopy:
68 # self.required_values.append("netboot/packages/"+x+"/files")
69 diff --git a/setup.py b/setup.py
70 index feca894..27ed2de 100755
71 --- a/setup.py
72 +++ b/setup.py
73 @@ -34,7 +34,7 @@ def _files(prefix, root):
74
75 Yielding `(target_dir, (file_source_paths, ...))` tuples.
76 """
77 - for dirpath, dirnames, filenames in _os.walk(root):
78 + for dirpath, _dirnames, filenames in _os.walk(root):
79 reldir = _os.path.relpath(dirpath, root)
80 install_directory = _posix_path(
81 _os.path.join(prefix, reldir))
82 --
83 2.5.2

Replies

Subject Author
Re: [gentoo-catalyst] [PATCH] lint: fix up unused variables Brian Dolbec <dolsen@g.o>