summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Demel <johannes@demels.de>2018-10-12 00:23:24 +0200
committerMartin Braun <martin.braun@ettus.com>2018-11-12 14:11:05 -0800
commit73cae35cfc63cc23474ce8d6196e868f21b6d3d4 (patch)
tree695189f97c1e35e884bf2f7dce6f16122a11ab22
parent2835b7b8c51f455953712ffcce9fafd62399d6c9 (diff)
GRC: fix failing thread run
In Py3k a string decode might trigger an error because it is already a unicode string. This is not the case in Py2k land. Thus, add a check.
-rw-r--r--grc/gui/Executor.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/grc/gui/Executor.py b/grc/gui/Executor.py
index 480917f3f1..d0137f96d8 100644
--- a/grc/gui/Executor.py
+++ b/grc/gui/Executor.py
@@ -83,7 +83,10 @@ class ExecFlowGraphThread(threading.Thread):
r = "\n"
while r:
GLib.idle_add(Messages.send_verbose_exec, r)
- r = self.process.stdout.read(1024).decode('utf-8','ignore')
+ r = self.process.stdout.read(1024)
+ if not isinstance(r, str):
+ r = r.decode('utf-8','ignore')
+
self.process.poll()
GLib.idle_add(self.done)