[v2,1/9] app/test-bbdev: support python3 only

Message ID 20200617151051.21191-2-louise.kilheeney@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series adding support for python 3 only. |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Louise Kilheeney June 17, 2020, 3:10 p.m. UTC
  Changed script to explicitly use python3 only to avoid
maintaining python 2.

Cc: Nicolas Chautru <nicolas.chautru@intel.com>

Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
---
 app/test-bbdev/test-bbdev.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
  

Comments

Anatoly Burakov June 25, 2020, 12:46 p.m. UTC | #1
On 17-Jun-20 4:10 PM, Louise Kilheeney wrote:
> Changed script to explicitly use python3 only to avoid
> maintaining python 2.
> 
> Cc: Nicolas Chautru <nicolas.chautru@intel.com>
> 
> Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
> Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
> ---
>   app/test-bbdev/test-bbdev.py | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/app/test-bbdev/test-bbdev.py b/app/test-bbdev/test-bbdev.py
> index 0194be046..ff2208381 100755
> --- a/app/test-bbdev/test-bbdev.py
> +++ b/app/test-bbdev/test-bbdev.py
> @@ -1,5 +1,4 @@
> -#!/usr/bin/env python
> -
> +#!/usr/bin/env python3
>   # SPDX-License-Identifier: BSD-3-Clause
>   # Copyright(c) 2017 Intel Corporation
>   
> @@ -12,7 +11,7 @@
>   from threading import Timer
>   
>   def kill(process):
> -    print "ERROR: Test app timed out"
> +    print("ERROR: Test app timed out")
>       process.kill()
>   
>   if "RTE_SDK" in os.environ:
> @@ -66,7 +65,7 @@ def kill(process):
>   args = parser.parse_args()
>   
>   if not os.path.exists(args.testapp_path):
> -    print "No such file: " + args.testapp_path
> +    print ("No such file: " + args.testapp_path)

Nitpick: don't leave space before parens :)

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

>       sys.exit(1)
>   
>   params = [args.testapp_path]
>
  

Patch

diff --git a/app/test-bbdev/test-bbdev.py b/app/test-bbdev/test-bbdev.py
index 0194be046..ff2208381 100755
--- a/app/test-bbdev/test-bbdev.py
+++ b/app/test-bbdev/test-bbdev.py
@@ -1,5 +1,4 @@ 
-#!/usr/bin/env python
-
+#!/usr/bin/env python3
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
@@ -12,7 +11,7 @@ 
 from threading import Timer
 
 def kill(process):
-    print "ERROR: Test app timed out"
+    print("ERROR: Test app timed out")
     process.kill()
 
 if "RTE_SDK" in os.environ:
@@ -66,7 +65,7 @@  def kill(process):
 args = parser.parse_args()
 
 if not os.path.exists(args.testapp_path):
-    print "No such file: " + args.testapp_path
+    print ("No such file: " + args.testapp_path)
     sys.exit(1)
 
 params = [args.testapp_path]