Remove six

We don't need this dependency anymore.

Change-Id: I816b9aa687b90299326085b642c992e42c11c029
This commit is contained in:
songwenping 2022-04-19 10:15:36 +08:00
parent ab5dcd10e9
commit 0ffbc53211
3 changed files with 5 additions and 9 deletions

View File

@ -20,8 +20,6 @@ import subprocess
import sys import sys
import tempfile import tempfile
import six
from prompt_toolkit.completion import WordCompleter from prompt_toolkit.completion import WordCompleter
from prompt_toolkit import prompt from prompt_toolkit import prompt
from prompt_toolkit.validation import ValidationError from prompt_toolkit.validation import ValidationError
@ -55,9 +53,9 @@ Notes:
def to_unicode(blob, encoding='utf8'): def to_unicode(blob, encoding='utf8'):
if isinstance(blob, six.text_type): if isinstance(blob, str):
return blob return blob
elif isinstance(blob, six.binary_type): elif isinstance(blob, bytes):
return blob.decode(encoding) return blob.decode(encoding)
else: else:
raise TypeError("Unable to convert %r to a text type" % blob) raise TypeError("Unable to convert %r to a text type" % blob)

View File

@ -30,7 +30,6 @@ import tempfile
from openstack_governance import governance from openstack_governance import governance
import requests import requests
import six
# Disable warnings about insecure connections. # Disable warnings about insecure connections.
from requests.packages import urllib3 from requests.packages import urllib3
@ -1560,7 +1559,7 @@ def validate_stable_branches(deliv, context):
location = branch.location location = branch.location
if branch_mode == 'std' or branch_mode == 'std-with-versions': if branch_mode == 'std' or branch_mode == 'std-with-versions':
if not isinstance(location, six.string_types): if not isinstance(location, str):
context.error( context.error(
('branch location for %s is ' ('branch location for %s is '
'expected to be a string but got a %s' % ( 'expected to be a string but got a %s' % (
@ -1645,7 +1644,7 @@ def validate_stable_branches(deliv, context):
) )
elif branch_mode == 'upstream': elif branch_mode == 'upstream':
if not isinstance(location, six.string_types): if not isinstance(location, str):
context.error( context.error(
('branch location for %s is ' ('branch location for %s is '
'expected to be a string but got a %s' % ( 'expected to be a string but got a %s' % (

View File

@ -29,7 +29,6 @@ from docutils import core
from docutils import nodes from docutils import nodes
from docutils.utils import column_width from docutils.utils import column_width
from docutils import writers from docutils import writers
from six.moves import zip_longest
from sphinx import addnodes from sphinx import addnodes
@ -563,7 +562,7 @@ class TextTranslator(nodes.NodeVisitor):
self.add_text(''.join(out) + self.nl) self.add_text(''.join(out) + self.nl)
def writerow(row): def writerow(row):
lines = zip_longest(*row) lines = itertools.zip_longest(*row)
for line in lines: for line in lines:
out = ['|'] out = ['|']
for i, cell in enumerate(line): for i, cell in enumerate(line):