vici: Remove support for Python 2

Python 2 is dead and unmaintained for a while now. Time to stop carrying
on its support.
This commit is contained in:
Martin Willi
2022-12-12 14:38:09 +01:00
committed by Tobias Brunner
parent a2b1e06f07
commit 11b18f65b1
5 changed files with 2 additions and 23 deletions
@@ -6,7 +6,6 @@ EXTRA_DIST = LICENSE README.rst MANIFEST.in \
test/test_protocol.py \ test/test_protocol.py \
vici/__init__.py \ vici/__init__.py \
vici/command_wrappers.py \ vici/command_wrappers.py \
vici/compat.py \
vici/exception.py \ vici/exception.py \
vici/protocol.py \ vici/protocol.py \
vici/session.py vici/session.py
@@ -20,7 +20,6 @@ setup(
"Intended Audience :: System Administrators", "Intended Audience :: System Administrators",
"License :: OSI Approved :: MIT License", "License :: OSI Approved :: MIT License",
"Natural Language :: English", "Natural Language :: English",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.8",
+1 -5
View File
@@ -1,5 +1,5 @@
[tox] [tox]
envlist = py27, py36, py37, py38, py39 envlist = py36, py37, py38, py39
[testenv] [testenv]
deps = deps =
@@ -7,10 +7,6 @@ deps =
pytest-pycodestyle pytest-pycodestyle
commands = pytest --pycodestyle commands = pytest --pycodestyle
[testenv:py{27}]
deps = pytest
commands = pytest
[pycodestyle] [pycodestyle]
max-line-length = 80 max-line-length = 80
show-source = True show-source = True
@@ -1,14 +0,0 @@
# Help functions for compatibility between python version 2 and 3
# From http://legacy.python.org/dev/peps/pep-0469
try:
dict.iteritems
except AttributeError:
# python 3
def iteritems(d):
return iter(d.items())
else:
# python 2
def iteritems(d):
return d.iteritems()
@@ -5,7 +5,6 @@ import struct
from collections import namedtuple from collections import namedtuple
from collections import OrderedDict from collections import OrderedDict
from .compat import iteritems
from .exception import DeserializationException from .exception import DeserializationException
@@ -121,7 +120,7 @@ class Message(object):
def serialize_dict(d): def serialize_dict(d):
segment = bytes() segment = bytes()
for key, value in iteritems(d): for key, value in d.items():
if isinstance(value, dict): if isinstance(value, dict):
segment += ( segment += (
encode_named_type(cls.SECTION_START, key) encode_named_type(cls.SECTION_START, key)