5b0b956
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
5b0b956
From: Christophe Fergeau <cfergeau@redhat.com>
5b0b956
Date: Wed, 8 Feb 2017 17:07:56 +0100
5b0b956
Subject: [PATCH] Xspice: Fix Python3 str() vs bytes() confusion
5b0b956
5b0b956
With python3, without universal_newlines=True, Popen().stdout.read()
5b0b956
will return a byte array, while find(str) expects to operate on a
5b0b956
string.
5b0b956
I've checked that this still works with python2 as well.
5b0b956
---
5b0b956
 scripts/Xspice | 2 +-
5b0b956
 1 file changed, 1 insertion(+), 1 deletion(-)
5b0b956
5b0b956
diff --git a/scripts/Xspice b/scripts/Xspice
5b0b956
index 41fd80c..927dcb1 100755
5b0b956
--- a/scripts/Xspice
5b0b956
+++ b/scripts/Xspice
5b0b956
@@ -135,7 +135,7 @@ def agents_new_enough(args):
5b0b956
             return False
5b0b956
 
5b0b956
     for f in [args.vdagent_exec, args.vdagentd_exec]:
5b0b956
-        if Popen(args=[f, '-h'], stdout=PIPE).stdout.read().find('-S') == -1:
5b0b956
+        if Popen(args=[f, '-h'], stdout=PIPE, universal_newlines=True).stdout.read().find('-S') == -1:
5b0b956
             return False
5b0b956
     return True
5b0b956