From: Markus Lehtonen Date: Fri, 12 Sep 2014 12:48:20 +0000 (+0300) Subject: GitRepository/__git_inout: correctly handle input error X-Git-Tag: tizen/0.6.22-20150206~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f7faf56ac38dc0e702c82ae44e6c1c34ef00dfde;p=tools%2Fgit-buildpackage.git GitRepository/__git_inout: correctly handle input error Change-Id: I3c9b8851490c05719f77a9519418a98f572d68e3 Signed-off-by: Markus Lehtonen --- diff --git a/gbp/git/repository.py b/gbp/git/repository.py index 6b21c25..9843d99 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -252,7 +252,12 @@ class GitRepository(object): ready = select.select(out_fds, in_fds, []) # Write in chunks of 512 bytes if ready[1]: - popen.stdin.write(stdin[w_ind:w_ind+512]) + try: + popen.stdin.write(stdin[w_ind:w_ind+512]) + except IOError: + # Ignore, we want to read buffers to e.g. get error message + # Git should give an error code so that we catch an error + pass w_ind += 512 if w_ind > len(stdin): rm_polled_fd(popen.stdin, in_fds)