aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Sales de Andrade <quantum.analyst@gmail.com>2017-05-17 04:41:54 -0400
committerElliott Sales de Andrade <quantum.analyst@gmail.com>2017-05-17 04:41:54 -0400
commitea636fcd518f69c52e2a2753c5802e2bae66ab0d (patch)
tree3706c5f523bf50bd184542381c94ef91a2b3468b
parente66465369d3150cf4efcff8682c07197935ef3bc (diff)
downloadmeson-ea636fcd518f69c52e2a2753c5802e2bae66ab0d.zip
meson-ea636fcd518f69c52e2a2753c5802e2bae66ab0d.tar.gz
meson-ea636fcd518f69c52e2a2753c5802e2bae66ab0d.tar.bz2
Remove unused variables.
-rw-r--r--mesonbuild/backend/ninjabackend.py17
-rw-r--r--mesonbuild/build.py10
-rw-r--r--mesonbuild/dependencies/misc.py1
-rw-r--r--mesonbuild/mconf.py2
-rw-r--r--mesonbuild/modules/gnome.py2
-rw-r--r--mesonbuild/scripts/delwithsuffix.py6
-rw-r--r--mesonbuild/scripts/meson_install.py2
-rw-r--r--mesonbuild/wrap/wrap.py1
-rwxr-xr-xmesontest.py20
-rwxr-xr-xrun_project_tests.py1
-rwxr-xr-xrun_unittests.py1
11 files changed, 29 insertions, 34 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 928e9bf..4b12da6 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -315,14 +315,14 @@ int dummy;
# Now we handle the following languages:
# ObjC++, ObjC, C++, C, D, Fortran, Vala
- # Pre-existing target C/C++ sources to be built; dict of full path to
- # source relative to build root and the original File object.
- target_sources = OrderedDict()
- # GeneratedList and CustomTarget sources to be built; dict of the full
- # path to source relative to build root and the generating target/list
- generated_sources = OrderedDict()
- # Array of sources generated by valac that have to be compiled
- vala_generated_sources = []
+ # target_sources:
+ # Pre-existing target C/C++ sources to be built; dict of full path to
+ # source relative to build root and the original File object.
+ # generated_sources:
+ # GeneratedList and CustomTarget sources to be built; dict of the full
+ # path to source relative to build root and the generating target/list
+ # vala_generated_sources:
+ # Array of sources generated by valac that have to be compiled
if 'vala' in target.compilers:
# Sources consumed by valac are filtered out. These only contain
# C/C++ sources, objects, generated libs, and unknown sources now.
@@ -331,6 +331,7 @@ int dummy;
else:
target_sources = self.get_target_sources(target)
generated_sources = self.get_target_generated_sources(target)
+ vala_generated_sources = []
self.scan_fortran_module_outputs(target)
# Generate rules for GeneratedLists
self.generate_generator_list_rules(target, outfile)
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index ce6405b..242ce6f 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -227,8 +227,6 @@ class ExtractedObjects:
'You can only extract all the object files at once.'
raise MesonException(msg)
- def get_want_all_objects(self):
- return self.want_all_objects
class EnvironmentVariables:
def __init__(self):
@@ -238,7 +236,7 @@ class EnvironmentVariables:
repr_str = "<{0}: {1}>"
return repr_str.format(self.__class__.__name__, self.envvars)
- def get_value(self, name, values, kwargs):
+ def get_value(self, values, kwargs):
separator = kwargs.get('separator', os.pathsep)
value = ''
@@ -247,16 +245,16 @@ class EnvironmentVariables:
return separator, value.strip(separator)
def set(self, env, name, values, kwargs):
- return self.get_value(name, values, kwargs)[1]
+ return self.get_value(values, kwargs)[1]
def append(self, env, name, values, kwargs):
- sep, value = self.get_value(name, values, kwargs)
+ sep, value = self.get_value(values, kwargs)
if name in env:
return env[name] + sep + value
return value
def prepend(self, env, name, values, kwargs):
- sep, value = self.get_value(name, values, kwargs)
+ sep, value = self.get_value(values, kwargs)
if name in env:
return value + sep + env[name]
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py
index 3374c6e..e997807 100644
--- a/mesonbuild/dependencies/misc.py
+++ b/mesonbuild/dependencies/misc.py
@@ -95,7 +95,6 @@ class BoostDependency(Dependency):
def get_compile_args(self):
args = []
- include_dir = ''
if self.boost_root is not None:
if mesonlib.is_windows():
include_dir = self.boost_root
diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py
index 55860a4..14eddf5 100644
--- a/mesonbuild/mconf.py
+++ b/mesonbuild/mconf.py
@@ -61,7 +61,7 @@ class Conf:
len_name = longest_name = len(titles['name'])
len_descr = longest_descr = len(titles['descr'])
len_value = longest_value = len(titles['value'])
- len_choices = longest_choices = 0 # not printed if we don't get any optional values
+ longest_choices = 0 # not printed if we don't get any optional values
# calculate the max length of each
for x in arr:
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 134060f..b8092b2 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -730,7 +730,7 @@ class GnomeModule(ExtensionModule):
return args
- def gtkdoc_html_dir(self, state, args, kwarga):
+ def gtkdoc_html_dir(self, state, args, kwargs):
if len(args) != 1:
raise MesonException('Must have exactly one argument.')
modulename = args[0]
diff --git a/mesonbuild/scripts/delwithsuffix.py b/mesonbuild/scripts/delwithsuffix.py
index bd34202..0d410ae 100644
--- a/mesonbuild/scripts/delwithsuffix.py
+++ b/mesonbuild/scripts/delwithsuffix.py
@@ -15,12 +15,12 @@
import os, sys
def run(args):
- if len(sys.argv) != 3:
+ if len(args) != 2:
print('delwithsuffix.py <root of subdir to process> <suffix to delete>')
sys.exit(1)
- topdir = sys.argv[1]
- suffix = sys.argv[2]
+ topdir = args[0]
+ suffix = args[1]
if suffix[0] != '.':
suffix = '.' + suffix
diff --git a/mesonbuild/scripts/meson_install.py b/mesonbuild/scripts/meson_install.py
index fbcc2a4..d949090 100644
--- a/mesonbuild/scripts/meson_install.py
+++ b/mesonbuild/scripts/meson_install.py
@@ -34,7 +34,7 @@ def set_mode(path, mode):
except PermissionError as e:
msg = '{!r}: Unable to set owner {!r} and group {!r}: {}, ignoring...'
print(msg.format(path, mode.owner, mode.group, e.strerror))
- except LookupError as e:
+ except LookupError:
msg = '{!r}: Non-existent owner {!r} or group {!r}: ignoring...'
print(msg.format(path, mode.owner, mode.group))
except OSError as e:
diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py
index 713d685..4dc539a 100644
--- a/mesonbuild/wrap/wrap.py
+++ b/mesonbuild/wrap/wrap.py
@@ -178,7 +178,6 @@ class Resolver:
if is_there:
try:
subprocess.check_call(['git', 'rev-parse'], cwd=checkoutdir)
- is_there = True
except subprocess.CalledProcessError:
raise RuntimeError('%s is not empty but is not a valid '
'git repository, we can not work with it'
diff --git a/mesontest.py b/mesontest.py
index 101ce5f..bdbb44a 100755
--- a/mesontest.py
+++ b/mesontest.py
@@ -304,7 +304,7 @@ class TestHarness:
if jsonlogfile:
write_json_log(jsonlogfile, name, result)
- def print_summary(self, logfile, jsonlogfile):
+ def print_summary(self, logfile):
msg = '''
OK: %4d
FAIL: %4d
@@ -446,7 +446,7 @@ TIMEOUT: %4d
assert(isinstance(wrap, list))
return wrap
- def get_pretty_suite(self, test, tests):
+ def get_pretty_suite(self, test):
if len(self.suites) > 1:
rv = TestHarness.split_suite_string(test.suite[0])[0]
s = "+".join(TestHarness.split_suite_string(s)[1] for s in test.suite)
@@ -466,15 +466,15 @@ TIMEOUT: %4d
(logfile, logfilename, jsonlogfile, jsonlogfilename) = self.open_log_files()
wrap = self.get_wrapper()
- for i in range(self.options.repeat):
+ for _ in range(self.options.repeat):
for i, test in enumerate(tests):
- visible_name = self.get_pretty_suite(test, tests)
+ visible_name = self.get_pretty_suite(test)
if self.options.gdb:
test.timeout = None
if not test.is_parallel or self.options.gdb:
- self.drain_futures(futures, logfile, jsonlogfile)
+ self.drain_futures(futures)
futures = []
res = self.run_single_test(wrap, test)
self.print_stats(numlen, tests, visible_name, res, i, logfile, jsonlogfile)
@@ -488,8 +488,8 @@ TIMEOUT: %4d
if self.options.repeat > 1 and self.fail_count:
break
- self.drain_futures(futures, logfile, jsonlogfile)
- self.print_summary(logfile, jsonlogfile)
+ self.drain_futures(futures)
+ self.print_summary(logfile)
self.print_collected_logs()
if logfilename:
@@ -500,7 +500,7 @@ TIMEOUT: %4d
if logfile:
logfile.close()
- def drain_futures(self, futures, logfile, jsonlogfile):
+ def drain_futures(self, futures):
for i in futures:
(result, numlen, tests, name, i, logfile, jsonlogfile) = i
if self.options.repeat > 1 and self.fail_count:
@@ -525,7 +525,7 @@ TIMEOUT: %4d
def list_tests(th):
tests = th.get_tests()
for t in tests:
- print(th.get_pretty_suite(t, tests))
+ print(th.get_pretty_suite(t))
def merge_suite_options(options):
buildfile = os.path.join(options.wd, 'meson-private/build.dat')
@@ -558,7 +558,7 @@ def rebuild_all(wd):
return False
p = subprocess.Popen([ninja, '-C', wd])
- (stdo, stde) = p.communicate()
+ p.communicate()
if p.returncode != 0:
print("Could not rebuild")
diff --git a/run_project_tests.py b/run_project_tests.py
index e9f1942..7f7cfdc 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -217,7 +217,6 @@ def validate_install(srcdir, installdir, compiler):
# If this exists, the test does not install any other files
noinst_file = 'usr/no-installed-files'
expected = {}
- found = {}
ret_msg = ''
# Generate list of expected files
if os.path.exists(os.path.join(installdir, noinst_file)):
diff --git a/run_unittests.py b/run_unittests.py
index b8e5ff9..27df1bd 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -852,7 +852,6 @@ class AllPlatformTests(BasePlatformTests):
env = Environment(testdir, self.builddir, self.meson_command,
get_fake_options(self.prefix), [])
for lang, evar in langs:
- evalue = None
# Detect with evar and do sanity checks on that
if evar in os.environ:
ecc = getattr(env, 'detect_{}_compiler'.format(lang))(False)