sos/0038-Fix-plugin_test-exception-on-six.PY2.patch
Bryn M. Reeves 5261563507 Update sos to 3.1
Update sos to the 3.1 upstream release and add post-release patches
from the development tree.
2014-04-01 12:25:00 +01:00

33 lines
826 B
Diff

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/61] 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.7.11.7