summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-09-12 15:48:20 +0300
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-11-14 14:47:21 +0200
commitf7faf56ac38dc0e702c82ae44e6c1c34ef00dfde (patch)
treee19f9b217c54c0bb8d50a5fbcce31aea3716ec68
parenta803d61fc03e875d4a804936c6649f58a26e0c6e (diff)
downloadgit-buildpackage-f7faf56ac38dc0e702c82ae44e6c1c34ef00dfde.tar.gz
git-buildpackage-f7faf56ac38dc0e702c82ae44e6c1c34ef00dfde.tar.bz2
git-buildpackage-f7faf56ac38dc0e702c82ae44e6c1c34ef00dfde.zip
GitRepository/__git_inout: correctly handle input error
Change-Id: I3c9b8851490c05719f77a9519418a98f572d68e3 Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rw-r--r--gbp/git/repository.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index 6b21c252..9843d99b 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)