aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2019-12-04 18:54:47 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2019-12-05 00:22:10 +0200
commite4a0ee205d23a3d3af9dab9685ec330a41e553d5 (patch)
treee05291994cae465b456b74757685aabecf65c951
parentef19e1ff2d6b0f791a3b4c4fcfdf5e284cd448cc (diff)
downloadmeson-e4a0ee205d23a3d3af9dab9685ec330a41e553d5.zip
meson-e4a0ee205d23a3d3af9dab9685ec330a41e553d5.tar.gz
meson-e4a0ee205d23a3d3af9dab9685ec330a41e553d5.tar.bz2
lgtm: Fix redundant code
-rw-r--r--mesonbuild/compilers/mixins/clike.py1
-rw-r--r--mesonbuild/coredata.py4
-rw-r--r--mesonbuild/dependencies/base.py1
-rw-r--r--mesonbuild/dependencies/ui.py6
-rw-r--r--mesonbuild/minstall.py1
-rw-r--r--mesonbuild/mintro.py1
-rw-r--r--mesonbuild/mparser.py1
7 files changed, 3 insertions, 12 deletions
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py
index b5992ef..b5516b0 100644
--- a/mesonbuild/compilers/mixins/clike.py
+++ b/mesonbuild/compilers/mixins/clike.py
@@ -167,7 +167,6 @@ class CLikeCompiler:
retval.append(d)
# at this point, it's an ELF file which doesn't match the
# appropriate elf_class, so skip this one
- pass
return tuple(retval)
@functools.lru_cache()
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index cc9ca20..60eb388 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -618,8 +618,7 @@ class CoreData:
except MesonException as e:
raise type(e)(('Validation failed for option %s: ' % option_name) + str(e)) \
.with_traceback(sys.exc_info()[2])
- else:
- raise MesonException('Tried to validate unknown option %s.' % option_name)
+ raise MesonException('Tried to validate unknown option %s.' % option_name)
def get_external_args(self, for_machine: MachineChoice, lang):
return self.compiler_options[for_machine][lang + '_args'].value
@@ -659,7 +658,6 @@ class CoreData:
if not self.is_cross_build():
options = self.strip_build_option_names(options)
# Set prefix first because it's needed to sanitize other options
- prefix = self.builtins['prefix'].value
if 'prefix' in options:
prefix = self.sanitize_prefix(options['prefix'])
self.builtins['prefix'].set_value(prefix)
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index 8fc1982..2e83d8e 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -1794,7 +1794,6 @@ class ExternalProgram:
return commands + [script]
except Exception as e:
mlog.debug(e)
- pass
mlog.debug('Unusable script {!r}'.format(script))
return False
diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py
index 638bc68..bdcc4a7 100644
--- a/mesonbuild/dependencies/ui.py
+++ b/mesonbuild/dependencies/ui.py
@@ -605,16 +605,14 @@ class VulkanDependency(ExternalDependency):
# TODO: this config might not work on some platforms, fix bugs as reported
# we should at least detect other 64-bit platforms (e.g. armv8)
lib_name = 'vulkan'
+ lib_dir = 'lib'
+ inc_dir = 'include'
if mesonlib.is_windows():
lib_name = 'vulkan-1'
lib_dir = 'Lib32'
inc_dir = 'Include'
if detect_cpu_family(self.env.coredata.compilers.host) == 'x86_64':
lib_dir = 'Lib'
- else:
- lib_name = 'vulkan'
- lib_dir = 'lib'
- inc_dir = 'include'
# make sure header and lib are valid
inc_path = os.path.join(self.vulkan_sdk, inc_dir)
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py
index 3550abc..b1a55e5 100644
--- a/mesonbuild/minstall.py
+++ b/mesonbuild/minstall.py
@@ -503,7 +503,6 @@ def run(opts):
log_dir = os.path.join(private_dir, '../meson-logs')
if not os.path.exists(os.path.join(opts.wd, datafilename)):
sys.exit('Install data not found. Run this command in build directory root.')
- log_dir = os.path.join(private_dir, '../meson-logs')
if not opts.no_rebuild:
if not rebuild_all(opts.wd):
sys.exit(-1)
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index fb34b5a..8b66321 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -405,7 +405,6 @@ def run(options):
'meson version. Please regenerate it in this case.')
return 1
- intro_vers = '0.0.0'
with open(infofile, 'r') as fp:
raw = json.load(fp)
intro_vers = raw.get('introspection', {}).get('version', {}).get('full', '0.0.0')
diff --git a/mesonbuild/mparser.py b/mesonbuild/mparser.py
index 76ad374..2b503f1 100644
--- a/mesonbuild/mparser.py
+++ b/mesonbuild/mparser.py
@@ -674,7 +674,6 @@ class Parser:
a = ArgumentNode(s)
while not isinstance(s, EmptyNode):
- potential = self.current
if self.accept('colon'):
a.set_kwarg(s, self.statement())
potential = self.current