[master 3/9] Get rid of all the unused variable warnings.
clumens
installerbot-noreply at redhat.com
Fri Jul 17 13:50:08 UTC 2015
From: Chris Lumens <clumens at redhat.com>
---
meh/dump.py | 11 +++++------
tests/baseclass.py | 3 +--
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/meh/dump.py b/meh/dump.py
index bf983b2..c45741d 100644
--- a/meh/dump.py
+++ b/meh/dump.py
@@ -166,7 +166,7 @@ def get_package_and_component(file_=sys.argv[0]):
try:
name_end = srpm_name.rindex('-')
name_end = srpm_name[:name_end].rindex('-')
- except ValueError as e:
+ except ValueError:
# expected exception
pass
@@ -194,7 +194,7 @@ def get_other_packages(self):
if not self.stack:
return packages
- for (frame, fn, lineno, func, ctx, idx) in self.stack:
+ for (_frame, fn, _lineno, _func, _ctx, _idx) in self.stack:
try:
pkg_info = get_package_and_component(fn)[0]
package = "{0.name}-{0.version}-{0.release}.{0.arch}".format(
@@ -233,11 +233,10 @@ def get_environment_variables():
#--begining of the method _get_environment_info--
try:
pkg_info, component = get_package_and_component()
- except RPMinfoError as rpmierr:
+ except RPMinfoError:
pkg_info = None
component = None
- release_ver = get_release_version()
other_packages = ", ".join(get_other_packages(self))
ret = dict()
@@ -278,7 +277,7 @@ def _format_stack(self):
return []
frames = []
- for (frame, fn, lineno, func, ctx, idx) in self.stack:
+ for (_frame, fn, lineno, func, ctx, _idx) in self.stack:
if type(ctx) == type([]):
code = "".join(ctx)
else:
@@ -505,7 +504,7 @@ def hash(self):
s = ""
if self.stack:
- for (file, lineno, func, text) in [f[1:5] for f in self.stack]:
+ for (file, _lineno, func, text) in [f[1:5] for f in self.stack]:
if type(text) == type([]):
text = "".join(text)
s += "%s %s %s\n" % (os.path.basename(file), func, text)
diff --git a/tests/baseclass.py b/tests/baseclass.py
index 25be349..78ca1e2 100644
--- a/tests/baseclass.py
+++ b/tests/baseclass.py
@@ -56,7 +56,6 @@ def loadModules(moduleDir, cls_pattern="_TestCase", skip_list=["__init__", "base
sys.path.insert(0, moduleDir)
# Get a list of all *.py files in moduleDir
- moduleList = []
lst = map(lambda x: os.path.splitext(os.path.basename(x))[0],
glob.glob(moduleDir + "/*.py"))
@@ -68,7 +67,7 @@ def loadModules(moduleDir, cls_pattern="_TestCase", skip_list=["__init__", "base
# Attempt to load the found module.
try:
loaded = importlib.import_module(module)
- except ImportError as e:
+ except ImportError:
print("Error loading module %s." % module)
continue
--
To view this commit on github, visit https://github.com/rhinstaller/python-meh/commit/47ccda73c5c82f1f1f1e826797305ddf7f67d80a
More information about the anaconda-patches
mailing list