Skip to content

Commit fc417da

Browse files
author
Mike Dougherty
committed
Use communicate so as not to lock up the subprocess
1 parent 1e1e19d commit fc417da

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

git/remote.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import re
3434
import os
3535
import sys
36+
import io
3637

3738
__all__ = ('RemoteProgress', 'PushInfo', 'FetchInfo', 'Remote')
3839

@@ -547,10 +548,11 @@ def _get_push_info(self, proc, progress):
547548
# we hope stdout can hold all the data, it should ...
548549
# read the lines manually as it will use carriage returns between the messages
549550
# to override the previous one. This is why we read the bytes manually
550-
digest_process_messages(proc.stderr, progress)
551+
stdout, stderr = proc.communicate()
552+
digest_process_messages(io.StringIO(stderr), progress)
551553

552554
output = IterableList('name')
553-
for line in proc.stdout.readlines():
555+
for line in stdout.splitlines():
554556
try:
555557
output.append(PushInfo._from_line(self, line))
556558
except ValueError:
@@ -559,7 +561,6 @@ def _get_push_info(self, proc, progress):
559561
# END exception handling
560562
# END for each line
561563

562-
finalize_process(proc)
563564
return output
564565

565566
def fetch(self, refspec=None, progress=None, **kwargs):

0 commit comments

Comments
 (0)