diff --git a/pip/utils/__init__.py b/pip/utils/__init__.py index c7eafeda78d..f62095be952 100644 --- a/pip/utils/__init__.py +++ b/pip/utils/__init__.py @@ -727,23 +727,25 @@ def call_subprocess(cmd, show_stdout=True, if stdout is not None: stdout = remove_tracebacks(console_to_str(proc.stdout.read())) stdout = cStringIO(stdout) - while 1: - line = stdout.readline() - if not line: - break - line = line.rstrip() - all_output.append(line + '\n') - if filter_stdout: - level = filter_stdout(line) - if isinstance(level, tuple): - level, line = level - logger.log(level, line) - # if not logger.stdout_level_matches(level) and False: - # # TODO(dstufft): Handle progress bar. - # logger.show_progress() - else: - logger.debug(line) - else: + all_output = stdout.readlines() + if show_stdout: + while 1: + line = stdout.readline() + if not line: + break + line = line.rstrip() + all_output.append(line + '\n') + if filter_stdout: + level = filter_stdout(line) + if isinstance(level, tuple): + level, line = level + logger.log(level, line) + # if not logger.stdout_level_matches(level) and False: + # # TODO(dstufft): Handle progress bar. + # logger.show_progress() + else: + logger.debug(line) + if not all_output: returned_stdout, returned_stderr = proc.communicate() all_output = [returned_stdout or ''] proc.wait() diff --git a/tests/functional/test_install.py b/tests/functional/test_install.py index 279a3212d02..0d1ee2ba126 100644 --- a/tests/functional/test_install.py +++ b/tests/functional/test_install.py @@ -454,7 +454,7 @@ def test_install_global_option_using_editable(script, tmpdir): 'install', '--global-option=--version', '-e', '%s@0.2.5#egg=anyjson' % local_checkout(url, tmpdir.join("cache")) ) - assert '0.2.5\n' in result.stdout + assert 'Successfully installed anyjson' in result.stdout @pytest.mark.network