aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/python.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-08-17 17:21:26 -0400
committerEli Schwartz <eschwartz@archlinux.org>2021-08-18 17:54:51 -0400
commit9eac9e0ff20d7716b90ad5c61cfffc6cc6630005 (patch)
tree278be0c0c9e651cb1dad629febd57c3bdab0ccb6 /mesonbuild/modules/python.py
parent39a92c74e831cf3a6460749056ae8dc751c83f02 (diff)
downloadmeson-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.py6
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