From 647289fef6d89f6b00ff18cc851517c5f45849a6 Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Wed, 1 May 2024 10:05:56 -0700 Subject: [PATCH] Remove six dependency Change-Id: I6b7c8bed9d7ac6427e57bb146ce95de7e8bf1934 --- requirements.txt | 1 - stackviz/parser/log_node.py | 4 +--- stackviz/parser/tempest_subunit.py | 9 +-------- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/requirements.txt b/requirements.txt index cff9e9d..f46d434 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,3 @@ python-subunit>=0.0.18 testtools>=0.9.30 oslo.db>=6.0.0;python_version>='3.6' oslo.db==6.0.0;python_version<='3.5' -six diff --git a/stackviz/parser/log_node.py b/stackviz/parser/log_node.py index 857fcd4..d2f604c 100644 --- a/stackviz/parser/log_node.py +++ b/stackviz/parser/log_node.py @@ -12,8 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -import six - from datetime import datetime from datetime import timedelta @@ -147,7 +145,7 @@ class LogNode(object): else: if value is None: p.text(tc.Blue) - elif isinstance(value, six.string_types): + elif isinstance(value, str): p.text(tc.Red) elif isinstance(value, Number): p.text(tc.DarkGray) diff --git a/stackviz/parser/tempest_subunit.py b/stackviz/parser/tempest_subunit.py index 47bdc49..19e4a0e 100644 --- a/stackviz/parser/tempest_subunit.py +++ b/stackviz/parser/tempest_subunit.py @@ -15,7 +15,6 @@ import os import re import shutil -import six import subunit import sys @@ -144,13 +143,7 @@ class FileProvider(SubunitProvider): class StandardInputProvider(SubunitProvider): def __init__(self): self.buffer = BytesIO() - # Subunit is a binary protocol we need to ensure we read - # the contents as binary. On python3 this requires we use - # the stdin.buffer object as stdin is encoded otherwise. - if six.PY3: - shutil.copyfileobj(sys.stdin.buffer, self.buffer) - else: - shutil.copyfileobj(sys.stdin, self.buffer) + shutil.copyfileobj(sys.stdin.buffer, self.buffer) self.buffer.seek(0) @property