diff --git a/libcxx/utils/libcxx/test/target_info.py b/libcxx/utils/libcxx/test/target_info.py --- a/libcxx/utils/libcxx/test/target_info.py +++ b/libcxx/utils/libcxx/test/target_info.py @@ -191,25 +191,21 @@ def platform(self): return 'linux' - def platform_name(self): - name, _, _ = platform.linux_distribution() + def platform_name_ver(self): + import distro + name, ver, _ = distro.linux_distribution() # Some distros have spaces, e.g. 'SUSE Linux Enterprise Server' # lit features can't have spaces name = name.lower().strip().replace(' ', '-') - return name # Permitted to be None - - def platform_ver(self): - _, ver, _ = platform.linux_distribution() ver = ver.lower().strip().replace(' ', '-') - return ver # Permitted to be None. + return (name, ver) # Both permitted to be None def add_locale_features(self, features): add_common_locales(features, self.full_config.lit_config) # Some linux distributions have different locale data than others. # Insert the distributions name and name-version into the available # features to allow tests to XFAIL on them. - name = self.platform_name() - ver = self.platform_ver() + name, ver = self.platform_name_ver() if name: features.add(name) if name and ver: