diff --git a/README.md b/README.md index 24926b4..c536e7f 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ More information about Black, you find at The following software is required to run PTF: - * Python 2.7 or 3.x + * Python 3.x * six 1.16.0 * Scapy 2.4.5 (unless you provide another packet manipulation module) * pypcap (optional - VLAN tests will fail without this) diff --git a/ptf_nn/ptf_nn_agent.py b/ptf_nn/ptf_nn_agent.py index 2ecb121..d3bbc00 100644 --- a/ptf_nn/ptf_nn_agent.py +++ b/ptf_nn/ptf_nn_agent.py @@ -305,10 +305,7 @@ def forward(self, p, port): msg = struct.pack("=2.7, >=3 +python_requires = >=3 setup_requires = setuptools_scm install_requires = file: requirements.txt diff --git a/src/ptf/dataplane.py b/src/ptf/dataplane.py index a0739ec..fd250fe 100644 --- a/src/ptf/dataplane.py +++ b/src/ptf/dataplane.py @@ -32,7 +32,7 @@ from . import mask from . import packet from .pcap_writer import PcapWriter -from six import StringIO +from io import StringIO try: import nnpy @@ -321,10 +321,7 @@ def send(self, port_number, packet): packet, ) # because nnpy expects unicode when using str - if sys.version_info[0] == 2: - msg = list(msg) - else: - msg = bytearray(msg) + msg = bytearray(msg) self.socket.send(msg) # nnpy does not return the number of bytes sent return len(packet) diff --git a/src/ptf/mask.py b/src/ptf/mask.py index 8cb0574..32afb48 100644 --- a/src/ptf/mask.py +++ b/src/ptf/mask.py @@ -1,7 +1,7 @@ from __future__ import print_function import warnings -from six import StringIO +from io import StringIO import sys from . import packet diff --git a/src/ptf/testutils.py b/src/ptf/testutils.py index 0c069c6..46b926c 100755 --- a/src/ptf/testutils.py +++ b/src/ptf/testutils.py @@ -11,7 +11,7 @@ import ptf.parse import ptf.ptfutils import codecs -from six import StringIO +from io import StringIO global skipped_test_count skipped_test_count = 0 @@ -3179,7 +3179,7 @@ def ptf_ports(num=None): def port_to_tuple(port): - if type(port) is int or (sys.version_info[0] == 2 and type(port) is int): + if type(port) is int: return 0, port if type(port) is tuple: return port