Sophie

Sophie

distrib > Fedora > 19 > x86_64 > by-pkgid > 2183d0e55a8d454b8164909066cf1904 > files > 38

sos-3.1-1.fc19.src.rpm

From eb2b77cc38130882db71b73a5a026a454d261684 Mon Sep 17 00:00:00 2001
From: "Bryn M. Reeves" <bmr@redhat.com>
Date: Tue, 25 Mar 2014 17:26:11 +0000
Subject: [PATCH 38/72] Fix plugin_test exception on six.PY2

Replace explicit test for six.PY2 with try/exception handling of
StringIO import.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
---
 tests/plugin_tests.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/plugin_tests.py b/tests/plugin_tests.py
index c4b540f..31ffae4 100644
--- a/tests/plugin_tests.py
+++ b/tests/plugin_tests.py
@@ -4,9 +4,9 @@ import tempfile
 
 # PYCOMPAT
 import six
-if six.PY2:
+try:
     from StringIO import StringIO
-else:
+except:
     from io import StringIO
 
 from sos.plugins import Plugin, regex_findall, sos_relative_path, mangle_command
-- 
1.9.3