add python2 deprecation notice

Prepare for python2 removal in 20.11.

Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
This commit is contained in:
Louise Kilheeney 2020-07-10 11:10:47 +01:00 committed by David Marchand
parent c3fabbe957
commit ea0dceba0f
8 changed files with 30 additions and 1 deletions

View File

@ -16,6 +16,10 @@ def kill(process):
print("ERROR: Test app timed out")
process.kill()
if sys.version_info.major < 3:
print("WARNING: Python 2 is deprecated for use in DPDK, and will not work in future releases.", file=sys.stderr)
print("Please use Python 3 instead", file=sys.stderr)
if "RTE_SDK" in os.environ:
dpdk_path = os.environ["RTE_SDK"]
else:

View File

@ -19,6 +19,9 @@ def runTest(child, test):
return 0
child.expect(test["Result"], 1)
if sys.version_info.major < 3:
print("WARNING: Python 2 is deprecated for use in DPDK, and will not work in future releases.", file=sys.stderr)
print("Please use Python 3 instead", file=sys.stderr)
#
# history test is a special case

View File

@ -17,6 +17,10 @@ def usage():
usage()
sys.exit(1)
if sys.version_info.major < 3:
print("WARNING: Python 2 is deprecated for use in DPDK, and will not work in future releases.", file=sys.stderr)
print("Please use Python 3 instead", file=sys.stderr)
target = sys.argv[2]
test_whitelist = None

View File

@ -160,6 +160,10 @@ def __generate_internal_abi(f_out, lines):
print("};", file=f_out)
def __main():
if sys.version_info.major < 3:
print("WARNING: Python 2 is deprecated for use in DPDK, and will not work in future releases.", file=sys.stderr)
print("Please use Python 3 instead", file=sys.stderr)
arg_parser = argparse.ArgumentParser(
description='Merge versions in linker version script.')

View File

@ -10,6 +10,10 @@
except NameError:
xrange = range # Python 3
if sys.version_info.major < 3:
print("WARNING: Python 2 is deprecated for use in DPDK, and will not work in future releases.", file=sys.stderr)
print("Please use Python 3 instead", file=sys.stderr)
sockets = []
cores = []
core_map = {}

View File

@ -10,6 +10,10 @@
import subprocess
from os.path import exists, abspath, dirname, basename
if sys.version_info.major < 3:
print("WARNING: Python 2 is deprecated for use in DPDK, and will not work in future releases.", file=sys.stderr)
print("Please use Python 3 instead", file=sys.stderr)
# The PCI base class for all devices
network_class = {'Class': '02', 'Vendor': None, 'Device': None,
'SVendor': None, 'SDevice': None}

View File

@ -28,7 +28,9 @@
pcidb = None
# ===========================================
if sys.version_info.major < 3:
print("WARNING: Python 2 is deprecated for use in DPDK, and will not work in future releases.", file=sys.stderr)
print("Please use Python 3 instead", file=sys.stderr)
class Vendor:
"""

View File

@ -23,6 +23,10 @@
except NameError:
raw_input = input # Python 3
if sys.version_info.major < 3:
print("WARNING: Python 2 is deprecated for use in DPDK, and will not work in future releases.", file=sys.stderr)
print("Please use Python 3 instead", file=sys.stderr)
class Socket:
def __init__(self):