aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <proyvind@moondrake.org>2016-05-31 06:39:12 +0200
committerPer Øyvind Karlsen <proyvind@moondrake.org>2016-05-31 06:39:12 +0200
commit0b0958bd6a0778cbb02f4c178967ccd51e0bb5e0 (patch)
treec2f7e9f33f5e3d31f17abd41c0fc6497c423714c
parent4f5c8ad7fb2c7f10ad3a2a1b629a1bbe2715b7e3 (diff)
downloadmgarepo-0b0958bd6a0778cbb02f4c178967ccd51e0bb5e0.tar
mgarepo-0b0958bd6a0778cbb02f4c178967ccd51e0bb5e0.tar.gz
mgarepo-0b0958bd6a0778cbb02f4c178967ccd51e0bb5e0.tar.bz2
mgarepo-0b0958bd6a0778cbb02f4c178967ccd51e0bb5e0.tar.xz
mgarepo-0b0958bd6a0778cbb02f4c178967ccd51e0bb5e0.zip
make sure there's a buffer before trying to read what's left
-rw-r--r--MgaRepo/util.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/MgaRepo/util.py b/MgaRepo/util.py
index 9008a59..1237d12 100644
--- a/MgaRepo/util.py
+++ b/MgaRepo/util.py
@@ -78,7 +78,8 @@ def execcmd(*cmd, **kwargs):
if proc.stdout is not None:
output += proc.stdout.read(8192).decode('utf8')
# Make sure that we've emptied the buffer entirely
- output += proc.stdout.read().decode('utf8')
+ if proc.stdout is not None:
+ output += proc.stdout.read().decode('utf8')
if kwargs.get("strip", True):
output = output.rstrip()