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.
pull/9134/head
Eli Schwartz 3 years ago
parent 39a92c74e8
commit 9eac9e0ff2
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 6
      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') 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 # msys2's python3 has "-cpython-36m.dll", we have to be clever
split = suffix.rsplit('.', 1) # FIXME: explain what the specific cleverness is here
suffix = split.pop(-1) split, suffix = suffix.rsplit('.', 1)
args[0] += ''.join(s for s in split) args[0] += split
kwargs['name_prefix'] = '' kwargs['name_prefix'] = ''
kwargs['name_suffix'] = suffix kwargs['name_suffix'] = suffix

Loading…
Cancel
Save