From ce3fd4e0dc8563cfe94788e7600449797cacd5b1 Mon Sep 17 00:00:00 2001 From: Urban Wallasch Date: Mon, 24 May 2021 17:14:34 +0200 Subject: [PATCH] * Fixed str2int() to accept optional sign. --- ffpreview.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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): -- 2.30.2