Remove six usage

sphinx-feature-classification was declared python-3-only by change
I0f3e9d980c25545a in release 1.0.1 (2020-04-07 10:02:33 +0000).
It's never had six in requirements.txt despite importing six in
two files.  Now that consuming projects are all python-3-only,
six is not being pulled in by some other project's requirements.
So convert six usage to pure python 3.

Change-Id: I1917fda331860332242774019ac7ca54512430e3
This commit is contained in:
Brian Rosmaita 2022-12-16 22:49:55 -05:00
parent 4c0817f1bf
commit f8909fc1d5
2 changed files with 2 additions and 13 deletions

View File

@ -18,14 +18,12 @@ It is used via a single directive in the .rst file
.. support_matrix::
"""
import configparser
from os import path
import re
from docutils import nodes
from docutils.parsers import rst
import six
from six.moves import configparser
from sphinx.util.fileutil import copy_asset
KEY_PATTERN = re.compile("[^a-zA-Z0-9_]")
@ -222,11 +220,6 @@ class Directive(rst.Directive):
fname = self.arguments[0]
rel_fpath, fpath = env.relfn2path(fname)
# Handle deprecation of readfp in py3 for read_file that was not
# available in py2.
if six.PY2:
cfg.read_file = cfg.readfp
with open(fpath) as fp:
cfg.read_file(fp)

View File

@ -18,12 +18,11 @@ test_sphinx_feature_classification
Tests for `sphinx_feature_classification` module.
"""
import configparser
import os
import ddt
import fixtures
import six
from six.moves import configparser
from sphinx_feature_classification import support_matrix
from sphinx_feature_classification.tests import base
@ -39,9 +38,6 @@ class MatrixTestCase(base.TestCase):
directory = os.path.dirname(os.path.abspath(__file__))
config_file = os.path.join(directory, 'fakes', 'support-matrix.ini')
if six.PY2:
cfg.read_file = cfg.readfp
with open(config_file) as fp:
cfg.read_file(fp)