From 9eac9e0ff20d7716b90ad5c61cfffc6cc6630005 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 17 Aug 2021 17:21:26 -0400 Subject: 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. --- mesonbuild/modules/python.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mesonbuild/modules/python.py') diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index 65a73a735..5fea84394 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 -- cgit v1.2.3