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