From fca83df599fa76cbbf08544fed72e96e1934365f Mon Sep 17 00:00:00 2001 From: vitaut Date: Wed, 20 May 2015 11:45:16 -0700 Subject: [PATCH] Support old version of pip installed on Travis, take 2 --- doc/build.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/build.py b/doc/build.py index 92cc5ec5..d5a5a484 100755 --- a/doc/build.py +++ b/doc/build.py @@ -9,13 +9,13 @@ def pip_install(package, commit=None): "Install package using pip." if commit: cmd = ['pip', 'show', package.split('/')[1]] - p = Popen(cmd, stdout=PIPE) - output = p.communicate()[0] + p = Popen(cmd, stdout=PIPE, stderr=PIPE) + stdout, stderr = p.communicate() if p.returncode != 0: - if 'No command by the name pip show' in output: - return # Old version of pip - ignore - raise CalledProcessError(p.returncode, cmd) - if output: + # Check if pip supports the show command. + if 'No command by the name pip show' not in stderr: + raise CalledProcessError(p.returncode, cmd) + elif stdout: return # Already installed package = 'git+git://github.com/{0}.git@{1}'.format(package, commit) check_call(['pip', 'install', '-q', package])