diff options
author | Conley Owens <cco3@android.com> | 2013-11-21 10:38:03 -0800 |
---|---|---|
committer | Conley Owens <cco3@android.com> | 2013-11-21 10:38:03 -0800 |
commit | cbc0798f67b56b96f2bb6eac701b019d9bfd5e19 (patch) | |
tree | eab6ab897c7a87ae493767830d5de8d5354f65e1 | |
parent | d5a5b19efd2291914bcb861d527ae74e620a9d37 (diff) | |
download | git-repo-cbc0798f67b56b96f2bb6eac701b019d9bfd5e19.tar.gz |
Fix print of git-remote-persistent-https error
If git-remote-persistent-https fails, we use an iter() and then
subsequently a .read() on stderr. Python doesn't like this and
gives the following error message:
ValueError: Mixing iteration and read methods would lose data
This change removes the use of iter() to avoid the issue.
Change-Id: I980659b83229e2a559c20dcc7b116f8d2476abd5
-rw-r--r-- | project.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1840,11 +1840,11 @@ class Project(object): | |||
1840 | cookiefile = line[len(prefix):] | 1840 | cookiefile = line[len(prefix):] |
1841 | break | 1841 | break |
1842 | if p.wait(): | 1842 | if p.wait(): |
1843 | line = iter(p.stderr).next() | 1843 | err_msg = p.stderr.read() |
1844 | if ' -print_config' in line: | 1844 | if ' -print_config' in err_msg: |
1845 | pass # Persistent proxy doesn't support -print_config. | 1845 | pass # Persistent proxy doesn't support -print_config. |
1846 | else: | 1846 | else: |
1847 | print(line + p.stderr.read(), file=sys.stderr) | 1847 | print(err_msg, file=sys.stderr) |
1848 | if cookiefile: | 1848 | if cookiefile: |
1849 | return cookiefile | 1849 | return cookiefile |
1850 | except OSError as e: | 1850 | except OSError as e: |