Flush subprocess stdout before trying to read from it

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1491146 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2013-06-09 06:27:46 +00:00
parent a987468500
commit d0b01a2b76
1 changed files with 1 additions and 0 deletions

View File

@ -49,6 +49,7 @@ def runAndSendGPGPassword(command, password):
p = subprocess.Popen(command, shell=True, bufsize=0, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE)
f = open(LOG, 'ab')
while True:
p.stdout.flush()
line = p.stdout.readline()
if len(line) == 0:
break