Merge "Remove usage of six"

This commit is contained in:
Zuul 2020-04-04 22:56:53 +00:00 committed by Gerrit Code Review
commit 7b026748de
5 changed files with 4 additions and 15 deletions

View File

@ -15,8 +15,6 @@
import ast
import re
from six import PY2
from hacking import core
RE_ASSERT_RAISES_EXCEPTION = re.compile(r"self\.assertRaises\(Exception[,\)]")
@ -61,13 +59,7 @@ def hacking_except_format_assert(logical_line, noqa):
def is_none(node):
'''Check whether an AST node corresponds to None.
In Python 2 None uses the same ast.Name class that variables etc. use,
but in Python 3 there is a new ast.NameConstant class.
'''
if PY2:
return isinstance(node, ast.Name) and node.id == 'None'
'''Check whether an AST node corresponds to None.'''
return isinstance(node, ast.NameConstant) and node.value is None

View File

@ -11,12 +11,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from six import moves
import configparser
class Config(object):
def __init__(self, default_section=None, tox_file='tox.ini'):
conf = moves.configparser.RawConfigParser()
conf = configparser.RawConfigParser()
conf.read(tox_file)
self.conf = conf

View File

@ -20,7 +20,6 @@ import sys
import tempfile
import pkg_resources
import six
import testscenarios
from testtools import content
@ -75,7 +74,7 @@ def load_tests(loader, tests, pattern):
continue
check = entry.load()
if check.skip_on_py3 and six.PY3:
if check.skip_on_py3:
continue
name = entry.attrs[0]

View File

@ -22,7 +22,6 @@ pytz==2013.6
PyYAML==3.12
reno==2.5.0
requests==2.14.2
six==1.10.0
snowballstemmer==1.2.1
stestr==2.0.0
testscenarios==0.4

View File

@ -1,2 +1 @@
flake8<4.0.0,>=3.6.0 # MIT
six>=1.10.0 # MIT