[20.08,2/9] usertools/dpdk-devbind: support python3 only

Message ID 20200522132320.26373-3-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/Intel-compilation success Compilation OK

Commit Message

Louise Kilheeney May 22, 2020, 1:23 p.m. UTC
  Changed script to explicitly use python3 only.

Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
---
 usertools/dpdk-devbind.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Burakov, Anatoly May 28, 2020, 12:39 p.m. UTC | #1
On 22-May-20 2:23 PM, Louise Kilheeney wrote:
> Changed script to explicitly use python3 only.
> 
> Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
> ---

There is a bunch of old cruft in a few scripts, such as python 
compatibility checks and reimplementation of check_output. it would be 
nice if those were fixed as well.

If you look for imports or the word "python" in code, chance are you'll 
find some comments saying something about "let's do this hack for python 
2 compatibility" :)
  
Burakov, Anatoly May 28, 2020, 12:41 p.m. UTC | #2
On 28-May-20 1:39 PM, Burakov, Anatoly wrote:
> On 22-May-20 2:23 PM, Louise Kilheeney wrote:
>> Changed script to explicitly use python3 only.
>>
>> Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
>> ---
> 
> There is a bunch of old cruft in a few scripts, such as python 
> compatibility checks and reimplementation of check_output. it would be 
> nice if those were fixed as well.
> 
> If you look for imports or the word "python" in code, chance are you'll 
> find some comments saying something about "let's do this hack for python 
> 2 compatibility" :)
> 

I would also suggest using /usr/bin/env python3 rather than explicit 
path to /usr/bin/python3.
  

Patch

diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index 40b4beea4..441301f2d 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -1,9 +1,8 @@ 
-#! /usr/bin/env python
+#! /usr/bin/env python3
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2010-2014 Intel Corporation
 #
 
-from __future__ import print_function
 import sys
 import os
 import getopt