Re: [PATCH nft v2] tests: py: fix python3.

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

 



On Sun, May 19, 2019 at 01:38:41AM +0530, Shekhar Sharma wrote:
> The '__future__' package has been added to nft-test.py in this patch. 
> The file runs in python 2 but when I try to run it in python 3, there is a error in argparse.ArgumentParser() in line 1325 with an option '-version' , 
> I suspect that '-version' is not valid in python 3 but I am not sure.

argparse was/is semi compatible with optparse. optparse allowed the
"version" argument as part of the constructor. Apparently python3's
argparse is less compatible. It's best to replace this entirely with the
"version" action as that'll work in both python2 and python3.

    https://docs.python.org/3/library/argparse.html#action

> 
> Signed-off-by: Shekhar Sharma <shekhar250198@xxxxxxxxx>
> ---
[..]



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

  Powered by Linux