diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-08-17 17:21:26 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2021-08-18 17:54:51 -0400 |
commit | 9eac9e0ff20d7716b90ad5c61cfffc6cc6630005 (patch) | |
tree | 278be0c0c9e651cb1dad629febd57c3bdab0ccb6 /mesonbuild/modules/python.py | |
parent | 39a92c74e831cf3a6460749056ae8dc751c83f02 (diff) | |
download | meson-9eac9e0ff20d7716b90ad5c61cfffc6cc6630005.zip meson-9eac9e0ff20d7716b90ad5c61cfffc6cc6630005.tar.gz meson-9eac9e0ff20d7716b90ad5c61cfffc6cc6630005.tar.bz2 |
fix some confusingly indirect code
rsplit(..., 1) always produces exactly one split, by design, there's no
need to then join a 1-element list via a generator comprehension after
extracting the end of it via pop. If this commit message sounds
confusing, then so was I when trying to figure out what this actually
did and if it needed extracting to PythonExternalModule.
Diffstat (limited to 'mesonbuild/modules/python.py')
-rw-r--r-- | mesonbuild/modules/python.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index 65a73a7..5fea843 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -402,9 +402,9 @@ class PythonInstallation(ExternalProgramHolder): suffix = self.variables.get('EXT_SUFFIX') or self.variables.get('SO') or self.variables.get('.so') # msys2's python3 has "-cpython-36m.dll", we have to be clever - split = suffix.rsplit('.', 1) - suffix = split.pop(-1) - args[0] += ''.join(s for s in split) + # FIXME: explain what the specific cleverness is here + split, suffix = suffix.rsplit('.', 1) + args[0] += split kwargs['name_prefix'] = '' kwargs['name_suffix'] = suffix |