From 0b0958bd6a0778cbb02f4c178967ccd51e0bb5e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=98yvind=20Karlsen?= Date: Tue, 31 May 2016 06:39:12 +0200 Subject: make sure there's a buffer before trying to read what's left --- MgaRepo/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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() -- cgit v1.2.1