summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2017-02-08 17:07:56 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2017-02-08 17:08:27 +0100
commit9a7eb40fa23b908d9f62a8f04933fdafd04d6b88 (patch)
tree1a47cd95b94054407de0ad63592fba38323c7670
parentb9955a35b42c156c343bd6f673c3e973397ce654 (diff)
Xspice: Fix Python3 str() vs bytes() confusion
With python3, without universal_newlines=True, Popen().stdout.read() will return a byte array, while find(str) expects to operate on a string. I've checked that this still works with python2 as well.
-rwxr-xr-xscripts/Xspice2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/Xspice b/scripts/Xspice
index 41fd80c..927dcb1 100755
--- a/scripts/Xspice
+++ b/scripts/Xspice
@@ -135,7 +135,7 @@ def agents_new_enough(args):
return False
for f in [args.vdagent_exec, args.vdagentd_exec]:
- if Popen(args=[f, '-h'], stdout=PIPE).stdout.read().find('-S') == -1:
+ if Popen(args=[f, '-h'], stdout=PIPE, universal_newlines=True).stdout.read().find('-S') == -1:
return False
return True