From: Urban Wallasch Date: Mon, 24 May 2021 15:14:34 +0000 (+0200) Subject: * Fixed str2int() to accept optional sign. X-Git-Tag: v0.4~35 X-Git-Url: https://git.packet-gain.de/?a=commitdiff_plain;h=ce3fd4e0dc8563cfe94788e7600449797cacd5b1;p=ffpreview.git * Fixed str2int() to accept optional sign. --- diff --git a/ffpreview.py b/ffpreview.py index 5a21620..d1b0a0d 100755 --- a/ffpreview.py +++ b/ffpreview.py @@ -119,7 +119,7 @@ def str2int(s): if type(s) == type(1): return s if s and type(s) == type(' '): - return int(re.match(r'^\s*(\d+)', s).groups()[0]) + return int(re.match(r'^\s*([+-]?\d+)', s).groups()[0]) return 0 def str2float(s):