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.

(cherry picked from commit 9eac9e0ff2)
0.59
Eli Schwartz 4 years ago committed by Nirbheek Chauhan
parent d6ff099aea
commit d449adad63
  1. 6
      mesonbuild/modules/python.py

@ -343,9 +343,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

Loading…
Cancel
Save