[v10,05/11] app/test-cmdline: support python3 only
Checks
Commit Message
Changed script to explicitly use python3 only to avoid
maintaining python 2 and removed deprecation notice.
Cc: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Robin Jarry <robin.jarry@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
v5:
- fixed python3 issue causing script to fail. Divisions without the
typecast lead to a floating point result, which was messing up the
loop.
v6:
- Removed changes to mk/rte.sdktest.mk since it no longer exists.
v8:
- Replaced integer cast with integer division operator.
---
app/test-cmdline/cmdline_test.py | 9 ++-------
app/test-cmdline/cmdline_test_data.py | 1 +
2 files changed, 3 insertions(+), 7 deletions(-)
@@ -1,9 +1,8 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2010-2014 Intel Corporation
# Script that runs cmdline_test app and feeds keystrokes into it.
-from __future__ import print_function
import cmdline_test_data
import os
import pexpect
@@ -19,10 +18,6 @@ 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
#
@@ -43,7 +38,7 @@ def runHistoryTest(child):
i = 0
# fill the history with numbers
- while i < history_size / 10:
+ while i < history_size // 10:
# add 1 to prevent from parsing as octals
child.send("1" + str(i).zfill(8) + cmdline_test_data.ENTER)
# the app will simply print out the number
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2010-2014 Intel Corporation