diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2016-12-21 00:09:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-21 00:09:44 +0200 |
commit | a2528a881640913dfc71fab7f15225d7e7d9a567 (patch) | |
tree | d4c90f6ae3a87624a4a7d7e90e48e2e700ee1d3f | |
parent | 39ab311019aed50c6baf3dcb2e1c1bfe0bbe15e8 (diff) | |
parent | 139e020ede8a954a276e69d5c1921884ef9725ce (diff) | |
download | meson-a2528a881640913dfc71fab7f15225d7e7d9a567.zip meson-a2528a881640913dfc71fab7f15225d7e7d9a567.tar.gz meson-a2528a881640913dfc71fab7f15225d7e7d9a567.tar.bz2 |
Merge pull request #1233 from mesonbuild/wip/ignatenko/code-style
Trivial cleanups in code
36 files changed, 51 insertions, 73 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index b265a24..dc39ce4 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -170,7 +170,6 @@ class Backend(): # For each language, generate a unity source file and return the list for comp, srcs in compsrcs.items(): - lang = comp.get_language() with init_language_file(comp.get_default_suffix()) as ofile: for src in srcs: ofile.write('#include<%s>\n' % src) @@ -655,7 +654,7 @@ class Backend(): # Subprojects of subprojects may cause the same dep args to be used # multiple times. Remove duplicates here. Note that we can't dedup - # libraries based on name alone, because "-lfoo -lbar -lfoo" is + # libraries based on name alone, because "-lfoo -lbar -lfoo" is # a completely valid (though pathological) sequence and removing the # latter may fail. Usually only applies to static libs, though. def dedup_arguments(self, commands): @@ -672,4 +671,3 @@ class Backend(): previous = c final_commands.append(c) return final_commands - diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 4c10e8d..40776a9 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -268,7 +268,7 @@ int dummy; return False suffix = os.path.splitext(source)[1][1:] for lang in self.langs_cant_unity: - if not lang in target.compilers: + if lang not in target.compilers: continue if suffix in target.compilers[lang].file_suffixes: return False @@ -433,7 +433,7 @@ int dummy; def process_target_dependencies(self, target, outfile): for t in target.get_dependencies(): tname = t.get_basename() + t.type_suffix() - if not tname in self.processed_targets: + if tname not in self.processed_targets: self.generate_target(t, outfile) def custom_target_generator_inputs(self, target, outfile): @@ -1283,7 +1283,6 @@ int dummy; outfile.write(command) outfile.write(description) outfile.write('\n') - scriptdir = self.environment.get_script_dir() outfile.write('\n') symrule = 'rule SHSYM\n' symcmd = ' command = "%s" "%s" %s %s %s %s $CROSS\n' % (ninja_quote(sys.executable), @@ -2077,7 +2076,7 @@ rule FORTRAN_DEP_HACK result = [] for ld in link_deps: prospective = self.get_target_dir(ld) - if not prospective in result: + if prospective not in result: result.append(prospective) return result diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index f3e9b4f..3ba63f4 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -14,7 +14,6 @@ import os, sys import pickle -import re import xml.dom.minidom import xml.etree.ElementTree as ET @@ -259,7 +258,7 @@ class Vs2010Backend(backends.Backend): ofile.write('\tEndGlobalSection\n') ofile.write('\tGlobalSection(ProjectConfigurationPlatforms) = ' 'postSolution\n') - ofile.write('\t\t{%s}.%s|%s.ActiveCfg = %s|%s\n' % + ofile.write('\t\t{%s}.%s|%s.ActiveCfg = %s|%s\n' % (self.environment.coredata.regen_guid, self.buildtype, self.platform, self.buildtype, self.platform)) ofile.write('\t\t{%s}.%s|%s.Build.0 = %s|%s\n' % @@ -734,7 +733,6 @@ class Vs2010Backend(backends.Backend): if len(target_args) > 0: target_args.append('%(AdditionalOptions)') ET.SubElement(clconf, "AdditionalOptions").text = ' '.join(target_args) - additional_options_set = True for d in target.include_dirs: for i in d.incdirs: @@ -930,7 +928,7 @@ class Vs2010Backend(backends.Backend): 'ToolsVersion' : '4.0', 'xmlns' : 'http://schemas.microsoft.com/developer/msbuild/2003'}) confitems = ET.SubElement(root, 'ItemGroup', {'Label' : 'ProjectConfigurations'}) - prjconf = ET.SubElement(confitems, 'ProjectConfiguration', + prjconf = ET.SubElement(confitems, 'ProjectConfiguration', {'Include' : self.buildtype + '|' + self.platform}) p = ET.SubElement(prjconf, 'Configuration') p.text= self.buildtype diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 87797e1..cc8f179 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from . import coredata from . import environment from . import dependencies from . import mlog @@ -317,7 +316,7 @@ class BuildTarget(): def check_unknown_kwargs_int(self, kwargs, known_kwargs): unknowns = [] for k in kwargs: - if not k in known_kwargs: + if k not in known_kwargs: unknowns.append(k) if len(unknowns) > 0: mlog.warning('Unknown keyword argument(s) in target %s: %s.' % @@ -349,7 +348,7 @@ class BuildTarget(): if hasattr(s, 'held_object'): s = s.held_object if isinstance(s, File): - if not s in added_sources: + if s not in added_sources: self.sources.append(s) added_sources[s] = True elif isinstance(s, (GeneratedList, CustomTarget)): @@ -880,7 +879,7 @@ class Generator(): for rule in outputs: if not isinstance(rule, str): raise InvalidArguments('"output" may only contain strings.') - if not '@BASENAME@' in rule and not '@PLAINNAME@' in rule: + if '@BASENAME@' not in rule and '@PLAINNAME@' not in rule: raise InvalidArguments('Every element of "output" must contain @BASENAME@ or @PLAINNAME@.') if '/' in rule or '\\' in rule: raise InvalidArguments('"outputs" must not contain a directory separator.') diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index 18f2791..ba8cba1 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -205,7 +205,7 @@ base_options = { 'Enable coverage tracking.', False), 'b_colorout' : coredata.UserComboOption('b_colorout', 'Use colored output', - ['auto', 'always', 'never'], + ['auto', 'always', 'never'], 'always'), 'b_ndebug' : coredata.UserBooleanOption('b_ndebug', 'Disable asserts', @@ -2557,12 +2557,12 @@ class SunFortranCompiler(FortranCompiler): class IntelFortranCompiler(FortranCompiler): std_warn_args = ['-warn', 'all'] - + def __init__(self, exelist, version, is_cross, exe_wrapper=None): self.file_suffixes = ('f', 'f90') super().__init__(exelist, version, is_cross, exe_wrapper=None) self.id = 'intel' - + def get_module_outdir_args(self, path): return ['-module', path] diff --git a/mesonbuild/dependencies.py b/mesonbuild/dependencies.py index da73a57..45f2ae4 100644 --- a/mesonbuild/dependencies.py +++ b/mesonbuild/dependencies.py @@ -20,7 +20,7 @@ # package before this gets too big. import re -import os, stat, glob, subprocess, shutil +import os, stat, glob, shutil import sysconfig from collections import OrderedDict from . mesonlib import MesonException, version_compare, version_compare_many, Popen_safe @@ -342,7 +342,7 @@ class WxDependency(Dependency): def get_requested(self, kwargs): modules = 'modules' - if not modules in kwargs: + if modules not in kwargs: return [] candidates = kwargs[modules] if isinstance(candidates, str): diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 52f5752..311b11c 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -826,9 +826,9 @@ class CrossBuildInfo(): self.parse_datafile(filename) if 'target_machine' in self.config: return - if not 'host_machine' in self.config: + if 'host_machine' not in self.config: raise mesonlib.MesonException('Cross info file must have either host or a target machine.') - if not 'binaries' in self.config: + if 'binaries' not in self.config: raise mesonlib.MesonException('Cross file is missing "binaries".') def ok_type(self, i): diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 7e55b88..e86f779 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -29,7 +29,7 @@ from .interpreterbase import check_stringlist, noPosargs, noKwargs, stringArgs from .interpreterbase import InterpreterException, InvalidArguments, InvalidCode from .interpreterbase import InterpreterObject, MutableInterpreterObject -import os, sys, subprocess, shutil, uuid, re +import os, sys, shutil, uuid import importlib @@ -222,7 +222,6 @@ class DependencyHolder(InterpreterObject): self.methods.update({'found' : self.found_method, 'type_name': self.type_name_method, 'version': self.version_method, - 'version': self.version_method, 'get_pkgconfig_variable': self.pkgconfig_method, }) @@ -1287,7 +1286,7 @@ class Interpreter(InterpreterBase): if len(args) != 1: raise InvalidCode('Import takes one argument.') modname = args[0] - if not modname in self.environment.coredata.modules: + if modname not in self.environment.coredata.modules: module = importlib.import_module('mesonbuild.modules.' + modname).initialize() self.environment.coredata.modules[modname] = module return ModuleHolder(modname, self.environment.coredata.modules[modname], self) @@ -1518,7 +1517,7 @@ class Interpreter(InterpreterBase): self.add_languages(args[1:], True) langs = self.coredata.compilers.keys() if 'vala' in langs: - if not 'c' in langs: + if 'c' not in langs: raise InterpreterException('Compiling Vala requires C. Add C to your project languages and rerun Meson.') if not self.is_subproject(): self.check_cross_stdlibs() @@ -1885,7 +1884,7 @@ requirements use the version keyword argument instead.''') all_args = args[1:] deps = [] elif len(args) == 1: - if not 'command' in kwargs: + if 'command' not in kwargs: raise InterpreterException('Missing "command" keyword argument') all_args = kwargs['command'] if not isinstance(all_args, list): @@ -2063,7 +2062,7 @@ requirements use the version keyword argument instead.''') def func_install_subdir(self, node, args, kwargs): if len(args) != 1: raise InvalidArguments('Install_subdir requires exactly one argument.') - if not 'install_dir' in kwargs: + if 'install_dir' not in kwargs: raise InvalidArguments('Missing keyword argument install_dir') install_dir = kwargs['install_dir'] if not isinstance(install_dir, str): @@ -2075,7 +2074,7 @@ requirements use the version keyword argument instead.''') def func_configure_file(self, node, args, kwargs): if len(args) > 0: raise InterpreterException("configure_file takes only keyword arguments.") - if not 'output' in kwargs: + if 'output' not in kwargs: raise InterpreterException('Required keyword argument "output" not defined.') inputfile = kwargs.get('input', None) output = kwargs['output'] @@ -2146,7 +2145,7 @@ requirements use the version keyword argument instead.''') 'been declared.\nThis is not permitted. Please declare all ' \ 'global arguments before your targets.' raise InvalidCode(msg) - if not 'language' in kwargs: + if 'language' not in kwargs: raise InvalidCode('Missing language definition in add_global_arguments') lang = kwargs['language'].lower() if lang in self.build.global_args: @@ -2169,7 +2168,7 @@ requirements use the version keyword argument instead.''') 'been declared.\nThis is not permitted. Please declare all ' \ 'global arguments before your targets.' raise InvalidCode(msg) - if not 'language' in kwargs: + if 'language' not in kwargs: raise InvalidCode('Missing language definition in add_global_link_arguments') lang = kwargs['language'].lower() if lang in self.build.global_link_args: @@ -2184,7 +2183,7 @@ requirements use the version keyword argument instead.''') 'been declared.\nThis is not permitted. Please declare all ' \ 'project link arguments before your targets.' raise InvalidCode(msg) - if not 'language' in kwargs: + if 'language' not in kwargs: raise InvalidCode('Missing language definition in add_project_link_arguments') lang = kwargs['language'].lower() if self.subproject not in self.build.projects_link_args: @@ -2201,7 +2200,7 @@ requirements use the version keyword argument instead.''') 'project arguments before your targets.' raise InvalidCode(msg) - if not 'language' in kwargs: + if 'language' not in kwargs: raise InvalidCode('Missing language definition in add_project_arguments') if self.subproject not in self.build.projects_args: diff --git a/mesonbuild/interpreterbase.py b/mesonbuild/interpreterbase.py index af1e8fb..d660f4c 100644 --- a/mesonbuild/interpreterbase.py +++ b/mesonbuild/interpreterbase.py @@ -633,4 +633,3 @@ class InterpreterBase: def is_elementary_type(self, v): return isinstance(v, (int, float, str, bool, list)) - diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py index 2db4d37..027dd58 100644 --- a/mesonbuild/mconf.py +++ b/mesonbuild/mconf.py @@ -104,7 +104,7 @@ class Conf: tgt.set_value(v) elif k.endswith('_link_args'): lang = k[:-10] - if not lang in self.coredata.external_link_args: + if lang not in self.coredata.external_link_args: raise ConfException('Unknown language %s in linkargs.' % lang) # TODO, currently split on spaces, make it so that user # can pass in an array string. @@ -112,7 +112,7 @@ class Conf: self.coredata.external_link_args[lang] = newvalue elif k.endswith('_args'): lang = k[:-5] - if not lang in self.coredata.external_args: + if lang not in self.coredata.external_args: raise ConfException('Unknown language %s in compile args' % lang) # TODO same fix as above newvalue = v.split() diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index 551bda2..5250cd3 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -14,7 +14,7 @@ """A library of random helper functionality.""" -import platform, subprocess, operator, os, shutil, re, sys +import platform, subprocess, operator, os, shutil, re from glob import glob diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index f72ddfa..62f4415 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -640,7 +640,7 @@ can not be used with the current version of glib-compiled-resources, due to modulename = args[0] if not isinstance(modulename, str): raise MesonException('Gtkdoc arg must be string.') - if not 'src_dir' in kwargs: + if 'src_dir' not in kwargs: raise MesonException('Keyword argument src_dir missing.') main_file = kwargs.get('main_sgml', '') if not isinstance(main_file, str): @@ -658,7 +658,7 @@ can not be used with the current version of glib-compiled-resources, due to namespace = kwargs.get('namespace', '') mode = kwargs.get('mode', 'auto') VALID_MODES = ('xml', 'sgml', 'none', 'auto') - if not mode in VALID_MODES: + if mode not in VALID_MODES: raise MesonException('gtkdoc: Mode {} is not a valid mode: {}'.format(mode, VALID_MODES)) src_dirs = kwargs['src_dir'] diff --git a/mesonbuild/modules/i18n.py b/mesonbuild/modules/i18n.py index 4df62f2..c4e4814 100644 --- a/mesonbuild/modules/i18n.py +++ b/mesonbuild/modules/i18n.py @@ -53,7 +53,7 @@ class I18nModule: file_type = kwargs.pop('type', 'xml') VALID_TYPES = ('xml', 'desktop') - if not file_type in VALID_TYPES: + if file_type not in VALID_TYPES: raise MesonException('i18n: "{}" is not a valid type {}'.format(file_type, VALID_TYPES)) kwargs['command'] = ['msgfmt', '--' + file_type, diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index f74f9e9..6c59f52 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from .. import coredata, build +from .. import build from .. import mesonlib from .. import mlog import os diff --git a/mesonbuild/modules/qt5.py b/mesonbuild/modules/qt5.py index da1ac83..35a475a 100644 --- a/mesonbuild/modules/qt5.py +++ b/mesonbuild/modules/qt5.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os, subprocess +import os from .. import mlog from .. import build from ..mesonlib import MesonException, Popen_safe diff --git a/mesonbuild/optinterpreter.py b/mesonbuild/optinterpreter.py index 4fe0843..99085e3 100644 --- a/mesonbuild/optinterpreter.py +++ b/mesonbuild/optinterpreter.py @@ -130,7 +130,7 @@ class OptionInterpreter: if 'type' not in kwargs: raise OptionException('Option call missing mandatory "type" keyword argument') opt_type = kwargs['type'] - if not opt_type in option_types: + if opt_type not in option_types: raise OptionException('Unknown type %s.' % opt_type) if len(posargs) != 1: raise OptionException('Option() must have one (and only one) positional argument') diff --git a/mesonbuild/scripts/meson_exe.py b/mesonbuild/scripts/meson_exe.py index 938ec87..5c5c317 100644 --- a/mesonbuild/scripts/meson_exe.py +++ b/mesonbuild/scripts/meson_exe.py @@ -17,9 +17,8 @@ import sys import argparse import pickle import platform -import subprocess -from ..mesonlib import MesonException, Popen_safe +from ..mesonlib import Popen_safe options = None diff --git a/mesonbuild/scripts/meson_install.py b/mesonbuild/scripts/meson_install.py index 0df79e3..11dd320 100644 --- a/mesonbuild/scripts/meson_install.py +++ b/mesonbuild/scripts/meson_install.py @@ -16,7 +16,7 @@ import sys, pickle, os, shutil, subprocess, gzip, platform from glob import glob from . import depfixer from . import destdir_join -from ..mesonlib import MesonException, Popen_safe +from ..mesonlib import Popen_safe install_log_file = None diff --git a/mesonbuild/scripts/regen_checker.py b/mesonbuild/scripts/regen_checker.py index 6f7ff79..4125f40 100644 --- a/mesonbuild/scripts/regen_checker.py +++ b/mesonbuild/scripts/regen_checker.py @@ -32,7 +32,6 @@ def need_regen(regeninfo, regen_timestamp): return False def regen(regeninfo, mesonscript, backend): - scriptdir = os.path.split(__file__)[0] cmd = [sys.executable, mesonscript, '--internal', diff --git a/mesonbuild/scripts/scanbuild.py b/mesonbuild/scripts/scanbuild.py index 2ef22bd..e17d2ad 100644 --- a/mesonbuild/scripts/scanbuild.py +++ b/mesonbuild/scripts/scanbuild.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys, os +import os import subprocess import shutil import tempfile diff --git a/mesonbuild/scripts/symbolextractor.py b/mesonbuild/scripts/symbolextractor.py index 9272495..bfd629f 100644 --- a/mesonbuild/scripts/symbolextractor.py +++ b/mesonbuild/scripts/symbolextractor.py @@ -20,9 +20,9 @@ # This file is basically a reimplementation of # http://cgit.freedesktop.org/libreoffice/core/commit/?id=3213cd54b76bc80a6f0516aac75a48ff3b2ad67c -import os, sys, subprocess +import os, sys from .. import mesonlib -from ..mesonlib import MesonException, Popen_safe +from ..mesonlib import Popen_safe import argparse parser = argparse.ArgumentParser() diff --git a/mesonbuild/scripts/yelphelper.py b/mesonbuild/scripts/yelphelper.py index 7431a81..76366a4 100644 --- a/mesonbuild/scripts/yelphelper.py +++ b/mesonbuild/scripts/yelphelper.py @@ -12,12 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys, os +import os import subprocess import shutil import argparse from .. import mlog -from ..mesonlib import MesonException from . import destdir_join parser = argparse.ArgumentParser() @@ -82,7 +81,6 @@ def install_help(srcdir, blddir, sources, media, langs, install_dir, destdir, pr os.makedirs(os.path.dirname(outfile), exist_ok=True) os.symlink(srcfile, outfile) continue - symfile = os.path.join(install_dir, m) mlog.log('Installing %s to %s.' %(infile, outfile)) if '/' in m or '\\' in m: os.makedirs(os.path.dirname(outfile), exist_ok=True) @@ -114,4 +112,3 @@ def run(args): merge_translations(build_subdir, abs_sources, langs) install_help(src_subdir, build_subdir, sources, media, langs, install_dir, destdir, options.project_id, options.symlinks) - diff --git a/run_project_tests.py b/run_project_tests.py index b4e8dba..41db27c 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -18,7 +18,7 @@ from glob import glob import os, subprocess, shutil, sys, signal from io import StringIO from ast import literal_eval -import sys, tempfile +import tempfile import mesontest from mesonbuild import environment from mesonbuild import mesonlib @@ -554,4 +554,3 @@ if __name__ == '__main__': for l in failing_logs: print(l, '\n') sys.exit(failing_tests) - diff --git a/run_tests.py b/run_tests.py index a40a2a6..baaad59 100755 --- a/run_tests.py +++ b/run_tests.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import subprocess, sys, os -import shutil +import subprocess, sys from mesonbuild import mesonlib if __name__ == '__main__': diff --git a/run_unittests.py b/run_unittests.py index 21d029d..d11c3f3 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -20,7 +20,7 @@ import tempfile from glob import glob import mesonbuild.environment from mesonbuild.environment import detect_ninja -from mesonbuild.dependencies import PkgConfigDependency, Qt5Dependency +from mesonbuild.dependencies import PkgConfigDependency def get_soname(fname): # HACK, fix to not use shell. @@ -16,7 +16,6 @@ import os import sys -from os import path if sys.version_info[0] < 3: print('Tried to install with Python 2, Meson only supports Python 3.') @@ -34,7 +33,6 @@ except ImportError: from distutils.file_util import copy_file from distutils.dir_util import mkpath -from stat import ST_MODE class install_scripts(orig): def run(self): @@ -49,7 +47,7 @@ class install_scripts(orig): # We want the files to be installed without a suffix on Unix for infile in self.get_inputs(): in_stripped = infile[:-3] if infile.endswith('.py') else infile - outfile = path.join(self.install_dir, in_stripped) + outfile = os.path.join(self.install_dir, in_stripped) # NOTE: Mode is preserved by default copy_file(infile, outfile, dry_run=self.dry_run) self.outfiles.append(outfile) diff --git a/test cases/common/103 manygen/subdir/manygen.py b/test cases/common/103 manygen/subdir/manygen.py index 8449dc3..8e74bcd 100755 --- a/test cases/common/103 manygen/subdir/manygen.py +++ b/test cases/common/103 manygen/subdir/manygen.py @@ -87,4 +87,3 @@ else: os.unlink(tmpo) os.unlink(tmpc) - diff --git a/test cases/common/107 postconf/postconf.py b/test cases/common/107 postconf/postconf.py index 50c91ca..950c706 100644 --- a/test cases/common/107 postconf/postconf.py +++ b/test cases/common/107 postconf/postconf.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -import sys, os +import os template = '''#pragma once diff --git a/test cases/common/113 generatorcustom/catter.py b/test cases/common/113 generatorcustom/catter.py index 7a6c085..198fa98 100755 --- a/test cases/common/113 generatorcustom/catter.py +++ b/test cases/common/113 generatorcustom/catter.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -import sys, os +import sys output = sys.argv[-1] inputs = sys.argv[1:-1] diff --git a/test cases/common/113 generatorcustom/gen.py b/test cases/common/113 generatorcustom/gen.py index c843497..c1e34ed 100755 --- a/test cases/common/113 generatorcustom/gen.py +++ b/test cases/common/113 generatorcustom/gen.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -import sys, os +import sys ifile = sys.argv[1] ofile = sys.argv[2] diff --git a/test cases/common/129 object only target/obj_generator.py b/test cases/common/129 object only target/obj_generator.py index 0a4537b..a1f7421 100755 --- a/test cases/common/129 object only target/obj_generator.py +++ b/test cases/common/129 object only target/obj_generator.py @@ -2,7 +2,7 @@ # Mimic a binary that generates an object file (e.g. windres). -import sys, shutil, subprocess +import sys, subprocess if __name__ == '__main__': if len(sys.argv) != 4: diff --git a/test cases/common/57 custom target chain/usetarget/subcomp.py b/test cases/common/57 custom target chain/usetarget/subcomp.py index 6f4b686..52dc0bb 100755 --- a/test cases/common/57 custom target chain/usetarget/subcomp.py +++ b/test cases/common/57 custom target chain/usetarget/subcomp.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -import sys, os +import sys with open(sys.argv[1], 'rb') as ifile: with open(sys.argv[2], 'w') as ofile: diff --git a/test cases/common/59 object generator/obj_generator.py b/test cases/common/59 object generator/obj_generator.py index 204f1eb..d028156 100755 --- a/test cases/common/59 object generator/obj_generator.py +++ b/test cases/common/59 object generator/obj_generator.py @@ -2,7 +2,7 @@ # Mimic a binary that generates an object file (e.g. windres). -import sys, shutil, subprocess +import sys, subprocess if __name__ == '__main__': if len(sys.argv) != 4: @@ -16,4 +16,3 @@ if __name__ == '__main__': else: cmd = [compiler, '-c', ifile, '-o', ofile] sys.exit(subprocess.call(cmd)) - diff --git a/test cases/common/95 dep fallback/subprojects/boblib/genbob.py b/test cases/common/95 dep fallback/subprojects/boblib/genbob.py index 824194b..7da3233 100644 --- a/test cases/common/95 dep fallback/subprojects/boblib/genbob.py +++ b/test cases/common/95 dep fallback/subprojects/boblib/genbob.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -import os import sys with open(sys.argv[1], 'w') as f: diff --git a/test cases/common/98 gen extra/srcgen.py b/test cases/common/98 gen extra/srcgen.py index 73bc337..8988cd9 100755 --- a/test cases/common/98 gen extra/srcgen.py +++ b/test cases/common/98 gen extra/srcgen.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 import sys -import os import argparse parser = argparse.ArgumentParser() diff --git a/test cases/vala/8 generated sources/src/copy_file.py b/test cases/vala/8 generated sources/src/copy_file.py index b90d91f..ff42ac3 100644 --- a/test cases/vala/8 generated sources/src/copy_file.py +++ b/test cases/vala/8 generated sources/src/copy_file.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -import os import sys import shutil |