Fix the error in the raise statement of check_positive()
1. In the raise statement of the check_positive() function, the error message conflicts with the if condition. 2. If the value of val is 0, it passes the if condition but raises an error message stating [0 has to be >= 0]. 3. This PR removes the = from the raise statement, so when val is 0, it will correctly prompt that the value of val [has to be > 0]. Signed-off-by: dufuhang <dufuhang@kylinos.cn>
This commit is contained in:
parent
c082797fd0
commit
ae2cfd52e8
1 changed files with 1 additions and 1 deletions
|
|
@ -34,7 +34,7 @@ def check_positive(value):
|
||||||
except ValueError:
|
except ValueError:
|
||||||
val = -1
|
val = -1
|
||||||
if val <= 0:
|
if val <= 0:
|
||||||
raise argparse.ArgumentTypeError("%s has to be >= 0" % value)
|
raise argparse.ArgumentTypeError("%s has to be > 0" % value)
|
||||||
return val
|
return val
|
||||||
|
|
||||||
def check_log_level(value):
|
def check_log_level(value):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue