commit 4f22d8eef1b0568a341110d907ec2036e652968e Author: vaydheesh Date: Mon Jul 22 18:41:18 2019 +0530 ValueError if unsupported target diff --git a/apertium/installer.py b/apertium/installer.py index 1702bd8..0ea1973 100644 --- a/apertium/installer.py +++ b/apertium/installer.py @@ -145,12 +145,15 @@ class Ubuntu: def get_installer(): if platform.system() == 'Windows': return Windows() - if platform.system() == 'Linux': + elif platform.system() == 'Linux': with open('/etc/os-release') as os_release: distro_name = os_release.readline().split('=')[-1].strip().replace('"', '') if distro_name == 'Ubuntu': return Ubuntu() - raise ValueError('Installation on {} not supported'.format(platform.system())) + else: + raise ValueError('Installation on {} not supported'.format(distro_name)) + else: + raise ValueError('Installation on {} not supported'.format(platform.system())) def install_apertium() -> None: