Commit 474ae9a8 authored by Davis E. King's avatar Davis E. King Committed by GitHub

Merge pull request #136 from AbdealiJK/ajk/setup

setup.py: Don't fail if pip fails in cmake err msg
parents 87dff094 8da4053c
...@@ -468,15 +468,19 @@ class build(_build): ...@@ -468,15 +468,19 @@ class build(_build):
message = msg_pkgmanager.format('OSX', manager) message = msg_pkgmanager.format('OSX', manager)
break break
elif sys.platform.startswith('linux'): elif sys.platform.startswith('linux'):
distname = None
try: try:
import distro import distro
except ImportError: except ImportError as err:
import pip import pip
pip_exit = pip.main(['install', 'distro']) pip_exit = pip.main(['install', '-q', 'distro'])
if pip_exit > 0: if pip_exit > 0:
raise SystemExit('Pip was unable to install `distro`') log.debug("Unable to install `distro` to identify "
"the recommended command. Falling back "
"to default error message.")
distro = err
else:
import distro import distro
if not isinstance(distro, ImportError):
distname = distro.id() distname = distro.id()
if distname in ('debian', 'ubuntu'): if distname in ('debian', 'ubuntu'):
message = msg_pkgmanager.format( message = msg_pkgmanager.format(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment