do not allow negative values in parse_num()

main
parent a2d846052e
commit 5b7f93bb9a
Signed by untrusted user: josch
GPG Key ID: F2CBA5C78FBD83E1

@ -2083,6 +2083,9 @@ def parse_num(num, name):
except ValueError:
msg = "%s is not a floating point number: %s" % (name, num)
raise argparse.ArgumentTypeError(msg)
if num < 0:
msg = "%s must not be negative: %s" % (name, num)
raise argparse.ArgumentTypeError(msg)
if unit == Unit.cm:
num = cm_to_pt(num)
elif unit == Unit.mm:

Loading…
Cancel
Save