Blob Blame History Raw
From b61a193b98b896164a8caefa088bb09297f1e3ca Mon Sep 17 00:00:00 2001
From: "Bryn M. Reeves" <bmr@redhat.com>
Date: Wed, 1 Oct 2014 17:08:50 +0100
Subject: [PATCH 01/93] [utilities] invert sense of six.PY2 test

Old versions of six do not include a 'PY2' attribute leading to
an exception in sos_get_command_output(). Invert the sense of the
test and check that six.PY3 is false instead as all versions of
the module include this attribute.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
---
 sos/utilities.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sos/utilities.py b/sos/utilities.py
index 7c06781..7e8cd7e 100644
--- a/sos/utilities.py
+++ b/sos/utilities.py
@@ -139,7 +139,7 @@ def sos_get_command_output(command, timeout=300, runat=None):
         command = "timeout %ds %s" % (timeout, command)
 
     # shlex.split() reacts badly to unicode on older python runtimes.
-    if six.PY2:
+    if not six.PY3:
         command = command.encode('utf-8')
     args = shlex.split(command)
     try:
-- 
1.9.3