diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-07-17 00:06:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-17 00:06:25 +0200 |
commit | f77c3176ab5cb583fc32bfdebeb320481b7d3592 (patch) | |
tree | 05ac4efbe915aed534b3678b3c358547176314ad | |
parent | 24c2e4d3ac4415a0033339cdc74c9251126166ed (diff) | |
parent | fff3ded2978ccbeae2d2f6a95415b663fce850d8 (diff) | |
download | meson-f77c3176ab5cb583fc32bfdebeb320481b7d3592.zip meson-f77c3176ab5cb583fc32bfdebeb320481b7d3592.tar.gz meson-f77c3176ab5cb583fc32bfdebeb320481b7d3592.tar.bz2 |
Merge pull request #2070 from mesonbuild/lgtmfixex
Static analyzer fixes
-rw-r--r-- | mesonbuild/backend/xcodebackend.py | 1 | ||||
-rw-r--r-- | mesonbuild/dependencies/ui.py | 1 | ||||
-rw-r--r-- | mesonbuild/interpreter.py | 24 | ||||
-rw-r--r-- | mesonbuild/scripts/depfixer.py | 2 | ||||
-rw-r--r-- | mesonbuild/scripts/vcstagger.py | 1 | ||||
-rwxr-xr-x | tools/ac_converter.py | 1 | ||||
-rwxr-xr-x | tools/cmake2meson.py | 1 |
7 files changed, 12 insertions, 19 deletions
diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py index c48fb07..199d7df 100644 --- a/mesonbuild/backend/xcodebackend.py +++ b/mesonbuild/backend/xcodebackend.py @@ -483,7 +483,6 @@ class XCodeBackend(backends.Backend): % (self.buildconflistmap[tname], tname)) self.write_line('buildPhases = (') self.indent_level += 1 - t = self.build.targets[tname] for bpname, bpval in t.buildphasemap.items(): self.write_line('%s /* %s yyy */,' % (bpval, bpname)) self.indent_level -= 1 diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py index f1ee7a6..1c59a41 100644 --- a/mesonbuild/dependencies/ui.py +++ b/mesonbuild/dependencies/ui.py @@ -390,7 +390,6 @@ class SDL2Dependency(ExternalDependency): return except Exception as e: mlog.debug('SDL 2 not found via pkgconfig. Trying next, error was:', str(e)) - pass if DependencyMethods.SDLCONFIG in self.methods: sdlconf = shutil.which('sdl2-config') if sdlconf: diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 8885e2b..63cdf9e 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -2007,9 +2007,6 @@ class Interpreter(InterpreterBase): raise DependencyException(m.format(name)) dep = cached_dep else: - # We need to actually search for this dep - exception = None - dep = None # If the dependency has already been configured, possibly by # a higher level project, try to use it first. if 'fallback' in kwargs: @@ -2022,13 +2019,15 @@ class Interpreter(InterpreterBase): except KeyError: pass + # We need to actually search for this dep + exception = None + dep = None + # Search for it outside the project - if not dep: - try: - dep = dependencies.find_external_dependency(name, self.environment, kwargs) - except DependencyException as e: - exception = e - pass + try: + dep = dependencies.find_external_dependency(name, self.environment, kwargs) + except DependencyException as e: + exception = e # Search inside the projects list if not dep or not dep.found(): @@ -2809,11 +2808,8 @@ different subdirectory. found = self.check_contains(element, args) if found: return True - try: - if element == item: - return True - except Exception: - pass + if element == item: + return True return False def is_subproject(self): diff --git a/mesonbuild/scripts/depfixer.py b/mesonbuild/scripts/depfixer.py index 1169b7e..1528ddb 100644 --- a/mesonbuild/scripts/depfixer.py +++ b/mesonbuild/scripts/depfixer.py @@ -337,7 +337,7 @@ def run(args): print('This application resets target rpath.') print('Don\'t run this unless you know what you are doing.') print('%s: <binary file> <prefix>' % sys.argv[0]) - exit(1) + sys.exit(1) with Elf(args[0]) as e: if len(args) == 1: e.print_rpath() diff --git a/mesonbuild/scripts/vcstagger.py b/mesonbuild/scripts/vcstagger.py index 19de9cb..62a45d9 100644 --- a/mesonbuild/scripts/vcstagger.py +++ b/mesonbuild/scripts/vcstagger.py @@ -36,6 +36,7 @@ def run(args): infile, outfile, fallback, source_dir, replace_string, regex_selector = args[0:6] command = args[6:] config_vcs_tag(infile, outfile, fallback, source_dir, replace_string, regex_selector, command) + return 0 if __name__ == '__main__': sys.exit(run(sys.argv[1:])) diff --git a/tools/ac_converter.py b/tools/ac_converter.py index cf00fd0..eda5097 100755 --- a/tools/ac_converter.py +++ b/tools/ac_converter.py @@ -39,7 +39,6 @@ function_data = \ 'HAVE_POSIX_MEMALIGN': ('posix_memalign', 'stdlib.h'), 'HAVE_SIGACTION': ('sigaction', 'signal.h'), 'HAVE_ALARM': ('alarm', 'unistd.h'), - 'HAVE_CLOCK_GETTIME': ('clock_gettime', 'time.h'), 'HAVE_CTIME_R': ('ctime_r', 'time.h'), 'HAVE_DRAND48': ('drand48', 'stdlib.h'), 'HAVE_FLOCKFILE': ('flockfile', 'stdio.h'), diff --git a/tools/cmake2meson.py b/tools/cmake2meson.py index eae6344..0789a0c 100755 --- a/tools/cmake2meson.py +++ b/tools/cmake2meson.py @@ -74,7 +74,6 @@ class Lexer: lineno += 1 col = 1 line_start = mo.end() - pass elif tid == 'varexp': yield(Token('varexp', match_text[2:-1])) else: |