aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.pylintrc1
-rw-r--r--mesonbuild/backend/ninjabackend.py2
-rw-r--r--mesonbuild/compilers/detect.py4
-rw-r--r--mesonbuild/compilers/rust.py2
-rw-r--r--mesonbuild/linkers/detect.py6
-rw-r--r--mesonbuild/linkers/linkers.py2
-rw-r--r--mesonbuild/modules/qt.py2
-rw-r--r--mesonbuild/scripts/depfixer.py2
8 files changed, 10 insertions, 11 deletions
diff --git a/.pylintrc b/.pylintrc
index 659d885..c185863 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -88,7 +88,6 @@ disable=
use-dict-literal,
use-implicit-booleaness-not-comparison,
use-list-literal,
- use-maxsplit-arg,
use-sequence-for-iteration,
used-before-assignment,
useless-return,
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 33f4970..91ecc20 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -3554,7 +3554,7 @@ def _scan_fortran_file_deps(src: Path, srcdir: Path, dirname: Path, tdeps, compi
ancestor_child = '_'.join(parents)
if ancestor_child not in tdeps:
- raise MesonException("submodule {} relies on ancestor module {} that was not found.".format(submodmatch.group(2).lower(), ancestor_child.split('_')[0]))
+ raise MesonException("submodule {} relies on ancestor module {} that was not found.".format(submodmatch.group(2).lower(), ancestor_child.split('_', maxsplit=1)[0]))
submodsrcfile = srcdir / tdeps[ancestor_child].fname # type: Path
if not submodsrcfile.is_file():
if submodsrcfile.name != src.name: # generated source file
diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py
index 4414a57..5c63d2d 100644
--- a/mesonbuild/compilers/detect.py
+++ b/mesonbuild/compilers/detect.py
@@ -473,7 +473,7 @@ def _detect_c_or_cpp_compiler(env: 'Environment', lang: str, for_machine: Machin
break
else:
raise EnvironmentException(f'Failed to detect MSVC compiler version: stderr was\n{err!r}')
- cl_signature = lookat.split('\n')[0]
+ cl_signature = lookat.split('\n', maxsplit=1)[0]
match = re.search(r'.*(x86|x64|ARM|ARM64)([^_A-Za-z0-9]|$)', cl_signature)
if match:
target = match.group(1)
@@ -593,7 +593,7 @@ def detect_cuda_compiler(env: 'Environment', for_machine: MachineChoice) -> Comp
# - CUDA Toolkit 8.0.61 requires NVIDIA Driver 375.26
# Luckily, the "V" also makes it very simple to extract
# the full version:
- version = out.strip().split('V')[-1]
+ version = out.strip().rsplit('V', maxsplit=1)[-1]
cpp_compiler = detect_cpp_compiler(env, for_machine)
cls = CudaCompiler
env.coredata.add_lang_args(cls.language, cls, for_machine, env)
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py
index 296c539..a7bab0f 100644
--- a/mesonbuild/compilers/rust.py
+++ b/mesonbuild/compilers/rust.py
@@ -111,7 +111,7 @@ class RustCompiler(Compiler):
def get_sysroot(self) -> str:
cmd = self.exelist + ['--print', 'sysroot']
p, stdo, stde = Popen_safe(cmd)
- return stdo.split('\n')[0]
+ return stdo.split('\n', maxsplit=1)[0]
def get_debug_args(self, is_debug: bool) -> T.List[str]:
return clike_debug_args[is_debug]
diff --git a/mesonbuild/linkers/detect.py b/mesonbuild/linkers/detect.py
index 9080444..e43c56b 100644
--- a/mesonbuild/linkers/detect.py
+++ b/mesonbuild/linkers/detect.py
@@ -83,7 +83,7 @@ def guess_win_linker(env: 'Environment', compiler: T.List[str], comp_class: T.Ty
check_args.extend(extra_args)
p, o, _ = Popen_safe(compiler + check_args)
- if 'LLD' in o.split('\n')[0]:
+ if 'LLD' in o.split('\n', maxsplit=1)[0]:
if '(compatible with GNU linkers)' in o:
return LLVMDynamicLinker(
compiler, for_machine, comp_class.LINKER_PREFIX,
@@ -98,7 +98,7 @@ def guess_win_linker(env: 'Environment', compiler: T.List[str], comp_class: T.Ty
# We've already hanedled the non-direct case above
p, o, e = Popen_safe(compiler + check_args)
- if 'LLD' in o.split('\n')[0]:
+ if 'LLD' in o.split('\n', maxsplit=1)[0]:
return ClangClDynamicLinker(
for_machine, [],
prefix=comp_class.LINKER_PREFIX if use_linker_prefix else [],
@@ -164,7 +164,7 @@ def guess_nix_linker(env: 'Environment', compiler: T.List[str], comp_class: T.Ty
v = search_version(o + e)
linker: DynamicLinker
- if 'LLD' in o.split('\n')[0]:
+ if 'LLD' in o.split('\n', maxsplit=1)[0]:
linker = LLVMDynamicLinker(
compiler, for_machine, comp_class.LINKER_PREFIX, override, version=v)
elif 'Snapdragon' in e and 'LLVM' in e:
diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py
index 30f41af..85fbcee 100644
--- a/mesonbuild/linkers/linkers.py
+++ b/mesonbuild/linkers/linkers.py
@@ -1475,7 +1475,7 @@ class CudaLinker(PosixDynamicLinkerMixin, DynamicLinker):
# Built on Sun_Sep_30_21:09:22_CDT_2018
# Cuda compilation tools, release 10.0, V10.0.166
# we need the most verbose version output. Luckily starting with V
- return out.strip().split('V')[-1]
+ return out.strip().rsplit('V', maxsplit=1)[-1]
def get_accepts_rsp(self) -> bool:
# nvcc does not support response files
diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py
index 6a223a8..3157c28 100644
--- a/mesonbuild/modules/qt.py
+++ b/mesonbuild/modules/qt.py
@@ -158,7 +158,7 @@ class QtBaseModule(ExtensionModule):
care = out
else:
care = err
- return care.split(' ')[-1].replace(')', '').strip()
+ return care.rsplit(' ', maxsplit=1)[-1].replace(')', '').strip()
p = state.find_program(b, required=False,
version_func=get_version,
diff --git a/mesonbuild/scripts/depfixer.py b/mesonbuild/scripts/depfixer.py
index c89f081..e89efbb 100644
--- a/mesonbuild/scripts/depfixer.py
+++ b/mesonbuild/scripts/depfixer.py
@@ -306,7 +306,7 @@ class Elf(DataSizes):
self.bf.seek(offset)
name = self.read_str()
if name.startswith(prefix):
- basename = name.split(b'/')[-1]
+ basename = name.rsplit(b'/', maxsplit=1)[-1]
padding = b'\0' * (len(name) - len(basename))
newname = basename + padding
assert len(newname) == len(name)