Skip to content

Commit

Permalink
ValueError if unsupported target
Browse files Browse the repository at this point in the history
  • Loading branch information
singh-lokendra committed Jul 22, 2019
1 parent 2874128 commit 4f22d8e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apertium/installer.py
Expand Up @@ -145,12 +145,15 @@ def install_wrapper(self, swig_wrapper: str) -> None:
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:
Expand Down

0 comments on commit 4f22d8e

Please sign in to comment.