Remove usage of six
The repo is python 3 only now, we can remove six usage and assume python3 everywhere. Change-Id: I0c742c2c7898914fae48b675e53c4dafb358bf9a
This commit is contained in:
parent
1c45c8cd60
commit
1fb57aae67
@ -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
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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]
|
||||
|
@ -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
|
||||
|
@ -1,2 +1 @@
|
||||
flake8<4.0.0,>=3.6.0 # MIT
|
||||
six>=1.10.0 # MIT
|
||||
|
Loading…
Reference in New Issue
Block a user