diff options
-rw-r--r-- | mesonbuild/astinterpreter.py | 2 | ||||
-rw-r--r-- | mesonbuild/backend/backends.py | 12 | ||||
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 14 | ||||
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 6 | ||||
-rw-r--r-- | mesonbuild/build.py | 18 | ||||
-rw-r--r-- | mesonbuild/compilers.py | 24 | ||||
-rw-r--r-- | mesonbuild/coredata.py | 2 | ||||
-rw-r--r-- | mesonbuild/dependencies.py | 6 | ||||
-rw-r--r-- | mesonbuild/environment.py | 10 | ||||
-rw-r--r-- | mesonbuild/interpreter.py | 6 | ||||
-rw-r--r-- | mesonbuild/interpreterbase.py | 4 | ||||
-rw-r--r-- | mesonbuild/mconf.py | 2 | ||||
-rw-r--r-- | mesonbuild/mesonlib.py | 4 | ||||
-rw-r--r-- | mesonbuild/mesonmain.py | 8 | ||||
-rw-r--r-- | mesonbuild/mlog.py | 2 | ||||
-rw-r--r-- | mesonbuild/mparser.py | 14 | ||||
-rw-r--r-- | mesonbuild/optinterpreter.py | 2 | ||||
-rw-r--r-- | mesonbuild/scripts/depfixer.py | 4 | ||||
-rw-r--r-- | mesonbuild/wrap/wraptool.py | 4 | ||||
-rwxr-xr-x | mesontest.py | 8 | ||||
-rwxr-xr-x | run_project_tests.py | 10 | ||||
-rwxr-xr-x | tools/cmake2meson.py | 6 |
22 files changed, 84 insertions, 84 deletions
diff --git a/mesonbuild/astinterpreter.py b/mesonbuild/astinterpreter.py index 1cdf523..32d0845 100644 --- a/mesonbuild/astinterpreter.py +++ b/mesonbuild/astinterpreter.py @@ -160,7 +160,7 @@ class AstInterpreter(interpreterbase.InterpreterBase): assert(isinstance(args, mparser.ArgumentNode)) if args.incorrect_order(): raise InvalidArguments('All keyword arguments must be after positional arguments.') - return (args.arguments, args.kwargs) + return args.arguments, args.kwargs def transform(self): self.load_root_meson_file() diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 26cba40..e46c2c5 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -22,7 +22,7 @@ import json import subprocess from ..mesonlib import MesonException, get_compiler_for_source, classify_unity_sources -class CleanTrees(): +class CleanTrees: ''' Directories outputted by custom targets that have to be manually cleaned because on Linux `ninja clean` only deletes empty directories. @@ -31,7 +31,7 @@ class CleanTrees(): self.build_dir = build_dir self.trees = trees -class InstallData(): +class InstallData: def __init__(self, source_dir, build_dir, prefix): self.source_dir = source_dir self.build_dir = build_dir @@ -45,7 +45,7 @@ class InstallData(): self.install_scripts = [] self.install_subdirs = [] -class ExecutableSerialisation(): +class ExecutableSerialisation: def __init__(self, name, fname, cmd_args, env, is_cross, exe_wrapper, workdir, extra_paths, capture): self.name = name @@ -76,7 +76,7 @@ class TestSerialisation: # This class contains the basic functionality that is needed by all backends. # Feel free to move stuff in and out of it as you see fit. -class Backend(): +class Backend: def __init__(self, build): self.build = build self.environment = build.environment @@ -247,7 +247,7 @@ class Backend(): benchmark_data = os.path.join(self.environment.get_scratch_dir(), 'meson_benchmark_setup.dat') with open(benchmark_data, 'wb') as datafile: self.write_benchmark_file(datafile) - return (test_data, benchmark_data) + return test_data, benchmark_data def determine_linker(self, target): ''' @@ -651,7 +651,7 @@ class Backend(): # # https://github.com/mesonbuild/meson/pull/737 cmd = [i.replace('\\', '/') for i in cmd] - return (srcs, ofilenames, cmd) + return srcs, ofilenames, cmd def run_postconf_scripts(self): env = {'MESON_SOURCE_ROOT': self.environment.get_source_dir(), diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index cdffb76..8de9b5a 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -36,7 +36,7 @@ else: def ninja_quote(text): return text.replace(' ', '$ ').replace(':', '$:') -class RawFilename(): +class RawFilename: """ Used when a filename is already relative to the root build directory, so that we know not to add the target's private build directory to it. @@ -56,7 +56,7 @@ class RawFilename(): def startswith(self, s): return self.fname.startswith(s) -class NinjaBuildElement(): +class NinjaBuildElement: def __init__(self, all_outputs, outfilenames, rule, infilenames): if isinstance(outfilenames, str): self.outfilenames = [outfilenames] @@ -830,7 +830,7 @@ int dummy; else: raise InvalidArguments('Unknown resource file %s.' % r) args.append(a) - return (args, deps) + return args, deps def generate_cs_target(self, target, outfile): buildtype = self.environment.coredata.get_builtin_option('buildtype') @@ -962,7 +962,7 @@ int dummy; raise InvalidArguments(msg) # Store 'somefile.vala': GeneratedList (or CustomTarget) srctype[f] = gensrc - return (vala, vapi, (others, othersgen)) + return vala, vapi, (others, othersgen) def generate_vala_compile(self, target, outfile): """Vala is compiled into C. Set up all necessary build steps here.""" @@ -1139,7 +1139,7 @@ int dummy; srcs.append(i) else: others.append(i) - return (srcs, others) + return srcs, others def generate_swift_target(self, target, outfile): module_name = self.target_swift_modulename(target) @@ -1933,7 +1933,7 @@ rule FORTRAN_DEP_HACK commands += pch_args commands += self.get_compile_debugfile_args(compiler, target, objname) dep = dst + '.' + compiler.get_depfile_suffix() - return (commands, dep, dst, [objname]) + return commands, dep, dst, [objname] def generate_gcc_pch_command(self, target, compiler, pch): commands = [] @@ -1941,7 +1941,7 @@ rule FORTRAN_DEP_HACK dst = os.path.join(self.get_target_private_dir(target), os.path.split(pch)[-1] + '.' + compiler.get_pch_suffix()) dep = dst + '.' + compiler.get_depfile_suffix() - return (commands, dep, dst, []) # Gcc does not create an object file during pch generation. + return commands, dep, dst, [] # Gcc does not create an object file during pch generation. def generate_pch(self, target, outfile): cstr = '' diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index 0cfbe90..525b7f0 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -47,7 +47,7 @@ def split_o_flags_args(args): o_flags += ['/O' + f for f in flags] return o_flags -class RegenInfo(): +class RegenInfo: def __init__(self, source_dir, build_dir, depfiles): self.source_dir = source_dir self.build_dir = build_dir @@ -313,7 +313,7 @@ class Vs2010Backend(backends.Backend): else: # Everything that is not an object or source file is considered a header. headers.append(i) - return (sources, headers, objects, languages) + return sources, headers, objects, languages def target_to_build_root(self, target): if target.subdir == '': @@ -512,7 +512,7 @@ class Vs2010Backend(backends.Backend): libs.append(arg) else: other.append(arg) - return (lpaths, libs, other) + return lpaths, libs, other def _get_cl_compiler(self, target): for lang, c in target.compilers.items(): diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 2ca1404..ceae49b 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -158,7 +158,7 @@ class Build: return link_args.get(compiler.get_language(), []) -class IncludeDirs(): +class IncludeDirs: def __init__(self, curdir, dirs, is_system, extra_build_dirs=None): self.curdir = curdir self.incdirs = dirs @@ -179,7 +179,7 @@ class IncludeDirs(): def get_extra_build_dirs(self): return self.extra_build_dirs -class ExtractedObjects(): +class ExtractedObjects: ''' Holds a list of sources for which the objects must be extracted ''' @@ -219,7 +219,7 @@ class ExtractedObjects(): def get_want_all_objects(self): return self.want_all_objects -class EnvironmentVariables(): +class EnvironmentVariables: def __init__(self): self.envvars = [] @@ -857,7 +857,7 @@ You probably should put it in link_with instead.''') return False -class Generator(): +class Generator: def __init__(self, args, kwargs): if len(args) != 1: raise InvalidArguments('Generator requires exactly one positional argument: the executable') @@ -940,7 +940,7 @@ class Generator(): return output -class GeneratedList(): +class GeneratedList: def __init__(self, generator, extra_args=[]): if hasattr(generator, 'held_object'): generator = generator.held_object @@ -1178,7 +1178,7 @@ class SharedLibrary(BuildTarget): # Visual Studio module-definitions file if 'vs_module_defs' in kwargs: path = kwargs['vs_module_defs'] - if (os.path.isabs(path)): + if os.path.isabs(path): self.vs_module_defs = File.from_absolute_file(path) else: self.vs_module_defs = File.from_source_file(environment.source_dir, self.subdir, path) @@ -1456,7 +1456,7 @@ class Jar(BuildTarget): def get_java_args(self): return self.java_args -class ConfigureFile(): +class ConfigureFile: def __init__(self, subdir, sourcename, targetname, configuration_data): self.subdir = subdir @@ -1482,7 +1482,7 @@ class ConfigureFile(): def get_target_name(self): return self.targetname -class ConfigurationData(): +class ConfigurationData: def __init__(self): super().__init__() self.values = {} @@ -1501,7 +1501,7 @@ class ConfigurationData(): # A bit poorly named, but this represents plain data files to copy # during install. -class Data(): +class Data: def __init__(self, sources, install_dir): self.sources = sources self.install_dir = install_dir diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index 649e6c1..22ee003 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -315,14 +315,14 @@ class CrossNoRunException(MesonException): def __init(self, *args, **kwargs): Exception.__init__(self, *args, **kwargs) -class RunResult(): +class RunResult: def __init__(self, compiled, returncode=999, stdout='UNDEFINED', stderr='UNDEFINED'): self.compiled = compiled self.returncode = returncode self.stdout = stdout self.stderr = stderr -class Compiler(): +class Compiler: def __init__(self, exelist, version): if isinstance(exelist, str): self.exelist = [exelist] @@ -561,7 +561,7 @@ class CCompiler(Compiler): return [] def split_shlib_to_parts(self, fname): - return (None, fname) + return None, fname # The default behaviour is this, override in # OSX and MSVC. @@ -1250,7 +1250,7 @@ class MonoCompiler(Compiler): return ['-warnaserror'] def split_shlib_to_parts(self, fname): - return (None, fname) + return None, fname def build_rpath_args(self, build_dir, rpath_paths, install_rpath): return [] @@ -1331,7 +1331,7 @@ class JavaCompiler(Compiler): return ['-Werror'] def split_shlib_to_parts(self, fname): - return (None, fname) + return None, fname def build_rpath_args(self, build_dir, rpath_paths, install_rpath): return [] @@ -1925,7 +1925,7 @@ class VisualStudioCCompiler(CCompiler): def gen_pch_args(self, header, source, pchname): objname = os.path.splitext(pchname)[0] + '.obj' - return (objname, ['/Yc' + header, '/Fp' + pchname, '/Fo' + objname]) + return objname, ['/Yc' + header, '/Fp' + pchname, '/Fo' + objname] def gen_import_library_args(self, implibname): "The name of the outputted import library" @@ -2140,7 +2140,7 @@ class GnuCompiler: return 'gch' def split_shlib_to_parts(self, fname): - return (os.path.split(fname)[0], fname) + return os.path.split(fname)[0], fname def get_soname_args(self, prefix, shlib_name, suffix, path, soversion, is_shared_module): return get_gcc_soname_args(self.gcc_type, prefix, shlib_name, suffix, path, soversion, is_shared_module) @@ -2260,7 +2260,7 @@ class GnuObjCPPCompiler(GnuCompiler, ObjCPPCompiler): # too strict without this and always fails. return self.get_no_optimization_args() + ['-fpermissive'] -class ClangCompiler(): +class ClangCompiler: def __init__(self, clang_type): self.id = 'clang' self.clang_type = clang_type @@ -2421,7 +2421,7 @@ class IntelCompiler: return os.path.split(header_name)[-1] + '.' + self.get_pch_suffix() def split_shlib_to_parts(self, fname): - return (os.path.split(fname)[0], fname) + return os.path.split(fname)[0], fname def get_soname_args(self, prefix, shlib_name, suffix, path, soversion, is_shared_module): if self.icc_type == ICC_STANDARD: @@ -2584,7 +2584,7 @@ end program prog return gnulike_buildtype_linker_args[buildtype] def split_shlib_to_parts(self, fname): - return (os.path.split(fname)[0], fname) + return os.path.split(fname)[0], fname def get_soname_args(self, prefix, shlib_name, suffix, path, soversion, is_shared_module): return get_gcc_soname_args(self.gcc_type, prefix, shlib_name, suffix, path, soversion, is_shared_module) @@ -2777,7 +2777,7 @@ class NAGFortranCompiler(FortranCompiler): return NAGFortranCompiler.std_warn_args -class VisualStudioLinker(): +class VisualStudioLinker: always_args = ['/NOLOGO'] def __init__(self, exelist): @@ -2824,7 +2824,7 @@ class VisualStudioLinker(): pdbarr += ['pdb'] return ['/DEBUG', '/PDB:' + '.'.join(pdbarr)] -class ArLinker(): +class ArLinker: def __init__(self, exelist): self.exelist = exelist diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 080067d..a7be91f 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -105,7 +105,7 @@ class UserStringArrayOption(UserOption): # invocations of Meson. It is roughly the same thing as # cmakecache. -class CoreData(): +class CoreData: def __init__(self, options): self.guid = str(uuid.uuid4()).upper() diff --git a/mesonbuild/dependencies.py b/mesonbuild/dependencies.py index 478722d..f6db323 100644 --- a/mesonbuild/dependencies.py +++ b/mesonbuild/dependencies.py @@ -33,7 +33,7 @@ class DependencyException(MesonException): def __init__(self, *args, **kwargs): MesonException.__init__(self, *args, **kwargs) -class Dependency(): +class Dependency: def __init__(self, type_name='unknown'): self.name = "null" self.is_found = False @@ -189,7 +189,7 @@ class PkgConfigDependency(Dependency): def _call_pkgbin(self, args): p, out = Popen_safe([self.pkgbin] + args, env=os.environ)[0:2] - return (p.returncode, out.strip()) + return p.returncode, out.strip() def _set_cargs(self): ret, out = self._call_pkgbin(['--cflags', self.name]) @@ -392,7 +392,7 @@ class WxDependency(Dependency): def found(self): return self.is_found -class ExternalProgram(): +class ExternalProgram: windows_exts = ('exe', 'com', 'bat') def __init__(self, name, fullpath=None, silent=False, search_dir=None): diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 7b10496..e143b0b 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -34,7 +34,7 @@ def find_coverage_tools(): lcov_exe = None if not mesonlib.exe_exists([genhtml_exe, '--version']): genhtml_exe = None - return (gcovr_exe, lcov_exe, genhtml_exe) + return gcovr_exe, lcov_exe, genhtml_exe def detect_ninja(version='1.5'): for n in ['ninja', 'ninja-build']: @@ -182,7 +182,7 @@ def search_version(text): return match.group(0) return 'unknown version' -class Environment(): +class Environment: private_dir = 'meson-private' log_dir = 'meson-logs' coredata_file = os.path.join(private_dir, 'coredata.dat') @@ -798,7 +798,7 @@ def get_args_from_envvars(compiler): compiler_is_linker = (compiler.get_exelist() == compiler.get_linker_exelist()) if lang not in ('c', 'cpp', 'objc', 'objcpp', 'fortran', 'd'): - return ([], []) + return [], [] # Compile flags cflags_mapping = {'c': 'CFLAGS', @@ -829,9 +829,9 @@ def get_args_from_envvars(compiler): log_var('CPPFLAGS', preproc_flags) compile_flags += preproc_flags.split() - return (compile_flags, link_flags) + return compile_flags, link_flags -class CrossBuildInfo(): +class CrossBuildInfo: def __init__(self, filename): self.config = {'properties': {}} self.parse_datafile(filename) diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index bee635f..b5cd0b6 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -186,7 +186,7 @@ class ConfigurationDataHolder(MutableInterpreterObject): if desc is not None and not isinstance(desc, str): raise InterpreterException('Description must be a string.') - return (name, val, desc) + return name, val, desc def set_method(self, args, kwargs): (name, val, desc) = self.validate_args(args, kwargs) @@ -1314,7 +1314,7 @@ class Interpreter(InterpreterBase): def module_method_callback(self, return_object): if not isinstance(return_object, ModuleReturnValue): - assert(False) + assert False raise InterpreterException('Bug in module, it returned an invalid object') invalues = return_object.new_objects self.process_new_values(invalues) @@ -1711,7 +1711,7 @@ class Interpreter(InterpreterBase): new_options[i].set_value(value) new_options.update(self.coredata.compiler_options) self.coredata.compiler_options = new_options - return (comp, cross_comp) + return comp, cross_comp def add_languages(self, args, required): success = True diff --git a/mesonbuild/interpreterbase.py b/mesonbuild/interpreterbase.py index 80413e2..e4dd58b 100644 --- a/mesonbuild/interpreterbase.py +++ b/mesonbuild/interpreterbase.py @@ -65,7 +65,7 @@ class InvalidCode(InterpreterException): class InvalidArguments(InterpreterException): pass -class InterpreterObject(): +class InterpreterObject: def __init__(self): self.methods = {} @@ -520,7 +520,7 @@ class InterpreterBase: reduced_kw[key] = self.evaluate_statement(a) if not isinstance(reduced_pos, list): reduced_pos = [reduced_pos] - return (reduced_pos, reduced_kw) + return reduced_pos, reduced_kw def flatten(self, args): if isinstance(args, mparser.StringNode): diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py index dfdcb94..c921409 100644 --- a/mesonbuild/mconf.py +++ b/mesonbuild/mconf.py @@ -231,7 +231,7 @@ def run(args): except ConfException as e: print('Meson configurator encountered an error:\n') print(e) - return(1) + return 1 return 0 if __name__ == '__main__': diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index c4f6769..305d945 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -208,7 +208,7 @@ def version_compare_many(vstr1, conditions): not_found.append(req) else: found.append(req) - return (not_found == [], not_found, found) + return not_found == [], not_found, found def default_libdir(): if is_debianlike(): @@ -395,4 +395,4 @@ def Popen_safe(args, write=None, stderr=subprocess.PIPE, **kwargs): stdout=subprocess.PIPE, stderr=stderr, **kwargs) o, e = p.communicate(write) - return (p, o, e) + return p, o, e diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py index 23501f8..37b8055 100644 --- a/mesonbuild/mesonmain.py +++ b/mesonbuild/mesonmain.py @@ -69,7 +69,7 @@ parser.add_argument('-v', '--version', action='version', version=coredata.version) parser.add_argument('directories', nargs='*') -class MesonApp(): +class MesonApp: def __init__(self, dir1, dir2, script_launcher, handshake, options, original_cmd_line_args): (self.source_dir, self.build_dir) = self.validate_dirs(dir1, dir2, handshake) @@ -106,9 +106,9 @@ class MesonApp(): if self.has_build_file(ndir1): if self.has_build_file(ndir2): raise RuntimeError('Both directories contain a build file %s.' % environment.build_filename) - return (ndir1, ndir2) + return ndir1, ndir2 if self.has_build_file(ndir2): - return (ndir2, ndir1) + return ndir2, ndir1 raise RuntimeError('Neither directory contains a build file %s.' % environment.build_filename) def validate_dirs(self, dir1, dir2, handshake): @@ -126,7 +126,7 @@ If you want to change option values, use the mesonconf tool instead.''' else: if handshake: raise RuntimeError('Something went terribly wrong. Please file a bug.') - return (src_dir, build_dir) + return src_dir, build_dir def check_pkgconfig_envvar(self, env): curvar = os.environ.get('PKG_CONFIG_PATH', '') diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py index cded2b0..a4f93d0 100644 --- a/mesonbuild/mlog.py +++ b/mesonbuild/mlog.py @@ -32,7 +32,7 @@ def shutdown(): if log_file is not None: log_file.close() -class AnsiDecorator(): +class AnsiDecorator: plain_code = "\033[0m" def __init__(self, text, code): diff --git a/mesonbuild/mparser.py b/mesonbuild/mparser.py index a005317..f8a0d2b 100644 --- a/mesonbuild/mparser.py +++ b/mesonbuild/mparser.py @@ -80,7 +80,7 @@ class Lexer: par_count = 0 bracket_count = 0 col = 0 - while(loc < len(code)): + while loc < len(code): matched = False value = None for (tid, reg) in self.token_specification: @@ -274,7 +274,7 @@ class PlusAssignmentNode: assert(isinstance(var_name, str)) self.value = value -class ForeachClauseNode(): +class ForeachClauseNode: def __init__(self, lineno, colno, varname, items, block): self.lineno = lineno self.colno = colno @@ -282,28 +282,28 @@ class ForeachClauseNode(): self.items = items self.block = block -class IfClauseNode(): +class IfClauseNode: def __init__(self, lineno, colno): self.lineno = lineno self.colno = colno self.ifs = [] self.elseblock = EmptyNode() -class UMinusNode(): +class UMinusNode: def __init__(self, current_location, value): self.subdir = current_location.subdir self.lineno = current_location.lineno self.colno = current_location.colno self.value = value -class IfNode(): +class IfNode: def __init__(self, lineno, colno, condition, block): self.lineno = lineno self.colno = colno self.condition = condition self.block = block -class TernaryNode(): +class TernaryNode: def __init__(self, lineno, colno, condition, trueblock, falseblock): self.lineno = lineno self.colno = colno @@ -311,7 +311,7 @@ class TernaryNode(): self.trueblock = trueblock self.falseblock = falseblock -class ArgumentNode(): +class ArgumentNode: def __init__(self, token): self.lineno = token.lineno self.colno = token.colno diff --git a/mesonbuild/optinterpreter.py b/mesonbuild/optinterpreter.py index 089eb2c..10b8fab 100644 --- a/mesonbuild/optinterpreter.py +++ b/mesonbuild/optinterpreter.py @@ -128,7 +128,7 @@ class OptionInterpreter: raise OptionException('Keyword argument name is not a string.') a = args.kwargs[key] reduced_kw[key] = self.reduce_single(a) - return (reduced_pos, reduced_kw) + return reduced_pos, reduced_kw def evaluate_statement(self, node): if not isinstance(node, mparser.FunctionNode): diff --git a/mesonbuild/scripts/depfixer.py b/mesonbuild/scripts/depfixer.py index 193d5b6..1404619 100644 --- a/mesonbuild/scripts/depfixer.py +++ b/mesonbuild/scripts/depfixer.py @@ -23,7 +23,7 @@ DT_STRTAB = 5 DT_SONAME = 14 DT_MIPS_RLD_MAP_REL = 1879048245 -class DataSizes(): +class DataSizes: def __init__(self, ptrsize, is_le): if is_le: p = '<' @@ -150,7 +150,7 @@ class Elf(DataSizes): is_le = False else: sys.exit('File "%s" has unknown ELF endianness.' % self.bfile) - return (ptrsize, is_le) + return ptrsize, is_le def parse_header(self): self.bf.seek(0) diff --git a/mesonbuild/wrap/wraptool.py b/mesonbuild/wrap/wraptool.py index 2663465..79bd5df 100644 --- a/mesonbuild/wrap/wraptool.py +++ b/mesonbuild/wrap/wraptool.py @@ -74,7 +74,7 @@ def get_latest_version(name): jd = get_result(API_ROOT + 'query/get_latest/' + name) branch = jd['branch'] revision = jd['revision'] - return (branch, revision) + return branch, revision def install(name): if not os.path.isdir('subprojects'): @@ -102,7 +102,7 @@ def get_current_version(wrapfile): arr = patch_url.split('/') branch = arr[-3] revision = int(arr[-2]) - return (branch, revision, cp['directory'], cp['source_filename'], cp['patch_filename']) + return branch, revision, cp['directory'], cp['source_filename'], cp['patch_filename'] def update(name): if not os.path.isdir('subprojects'): diff --git a/mesontest.py b/mesontest.py index e334a46..415ae4f 100755 --- a/mesontest.py +++ b/mesontest.py @@ -88,7 +88,7 @@ parser.add_argument('--setup', default=None, dest='setup', help='Which test setup to use.') parser.add_argument('args', nargs='*') -class TestRun(): +class TestRun: def __init__(self, res, returncode, should_fail, duration, stdo, stde, cmd, env): self.res = res @@ -337,7 +337,7 @@ TIMEOUT: %4d if ':' in suite: return suite.split(':', 1) else: - return (suite, "") + return suite, "" def test_in_suites(test, suites): for suite in suites: @@ -398,7 +398,7 @@ TIMEOUT: %4d def open_log_files(self): if not self.options.logbase or self.options.verbose: - return (None, None, None, None) + return None, None, None, None logfile_base = os.path.join(self.options.wd, 'meson-logs', self.options.logbase) @@ -416,7 +416,7 @@ TIMEOUT: %4d logfile.write('Log of Meson test suite run on %s.\n\n' % datetime.datetime.now().isoformat()) - return (logfile, logfilename, jsonlogfile, jsonlogfilename) + return logfile, logfilename, jsonlogfile, jsonlogfilename def get_wrapper(self): wrap = [] diff --git a/run_project_tests.py b/run_project_tests.py index 1f48be7..4715dbb 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -43,7 +43,7 @@ class TestResult: self.buildtime = buildtime self.testtime = testtime -class AutoDeletedDir(): +class AutoDeletedDir: def __init__(self, d): self.dir = d @@ -202,7 +202,7 @@ def run_configure_inprocess(commandlist): finally: sys.stdout = old_stdout sys.stderr = old_stderr - return (returncode, mystdout.getvalue(), mystderr.getvalue()) + return returncode, mystdout.getvalue(), mystderr.getvalue() def run_test_inprocess(testdir): old_stdout = sys.stdout @@ -218,7 +218,7 @@ def run_test_inprocess(testdir): sys.stdout = old_stdout sys.stderr = old_stderr os.chdir(old_cwd) - return (max(returncode_test, returncode_benchmark), mystdout.getvalue(), mystderr.getvalue()) + return max(returncode_test, returncode_benchmark), mystdout.getvalue(), mystderr.getvalue() def parse_test_args(testdir): args = [] @@ -457,7 +457,7 @@ def run_tests(all_tests, log_name_base, extra_args): print("Total build time: %.2fs" % build_time) print("Total test time: %.2fs" % test_time) ET.ElementTree(element=junit_root).write(xmlname, xml_declaration=True, encoding='UTF-8') - return (passing_tests, failing_tests, skipped_tests) + return passing_tests, failing_tests, skipped_tests def check_file(fname): linenum = 1 @@ -522,7 +522,7 @@ def generate_prebuilt(): object_suffix = 'o' objectfile = generate_pb_object(compiler, object_suffix) stlibfile = generate_pb_static(compiler, object_suffix, static_suffix) - return (objectfile, stlibfile) + return objectfile, stlibfile if __name__ == '__main__': parser = argparse.ArgumentParser(description="Run the test suite of Meson.") diff --git a/tools/cmake2meson.py b/tools/cmake2meson.py index 9f2c7c0..80bcaa4 100755 --- a/tools/cmake2meson.py +++ b/tools/cmake2meson.py @@ -24,7 +24,7 @@ class Token: self.lineno = 0 self.colno = 0 -class Statement(): +class Statement: def __init__(self, name, args): self.name = name self.args = args @@ -48,7 +48,7 @@ class Lexer: line_start = 0 loc = 0 col = 0 - while(loc < len(code)): + while loc < len(code): matched = False for (tid, reg) in self.token_specification: mo = reg.match(code, loc) @@ -83,7 +83,7 @@ class Lexer: if not matched: raise RuntimeError('Lexer got confused line %d column %d' % (lineno, col)) -class Parser(): +class Parser: def __init__(self, code): self.stream = Lexer().lex(code) self.getsym() |