Re: [PATCH nft v4] tests: py: fix python3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 23, 2019 at 11:56:22PM +0530, Shekhar Sharma wrote:
> This version of the patch converts the file into python3 and also uses
> .format() method to make the print statments cleaner.
> 
> The version history of this topic is:
> 
> v1: conversion to py3 by changing print statements.
> v2: adds the '__future__' package for compatibility with py2 and py3.
> v3: solves the 'version' problem in argparse by adding a new argument.
> v4: uses .format() method to make the print statements cleaner.
> 
> 
> Signed-off-by: Shekhar Sharma <shekhar250198@xxxxxxxxx>
> ---

Acked-by: Eric Garver <eric@xxxxxxxxxxx>

>  tests/py/nft-test.py | 47 ++++++++++++++++++++++++--------------------
>  1 file changed, 26 insertions(+), 21 deletions(-)
> 
> diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
> index 1c0afd0e..ab26d08d 100755
> --- a/tests/py/nft-test.py
> +++ b/tests/py/nft-test.py
[..]
> @@ -1353,15 +1358,15 @@ def main():
>      signal.signal(signal.SIGTERM, signal_handler)
>  
>      if os.getuid() != 0:
> -        print "You need to be root to run this, sorry"
> +        print("You need to be root to run this, sorry")
>          return
>  
>      # Change working directory to repository root
>      os.chdir(TESTS_PATH + "/../..")
>  
>      if not os.path.exists('src/.libs/libnftables.so'):
> -        print "The nftables library does not exist. " \
> -              "You need to build the project."
> +        print("The nftables library does not exist. " \
> +              "You need to build the project.")

nit: The trailing '\' can be removed now that the strings are inside
parenthesis. I don't think it's worth rerolling the patch though.



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux