diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-09-02 11:49:37 -0700 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-09-19 20:57:52 -0400 |
commit | 188c552dcfe4aad30041263685eb421240a72e6f (patch) | |
tree | 17dd732b57d452cde8ea95119818c84fb9a9bd26 /mesonbuild/compilers/detect.py | |
parent | b11cf2f37165ddf0ebe737e85768483ff4387481 (diff) | |
download | meson-188c552dcfe4aad30041263685eb421240a72e6f.zip meson-188c552dcfe4aad30041263685eb421240a72e6f.tar.gz meson-188c552dcfe4aad30041263685eb421240a72e6f.tar.bz2 |
pylint: enable use-maxsplit-arg
This finds a bunch of places where we can do more efficient string
splitting.
Diffstat (limited to 'mesonbuild/compilers/detect.py')
-rw-r--r-- | mesonbuild/compilers/detect.py | 4 |
1 files changed, 2 insertions, 2 deletions
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) |