From f7bd062bdbc1a2dd934a73bd0ea7f1ea9f778029 Mon Sep 17 00:00:00 2001 From: Paul Culley Date: Wed, 16 Oct 2019 16:47:55 -0500 Subject: [PATCH] Fix CLI parser to accept negative integers as valid (#927) Fixes #11381 --- gramps/cli/plug/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gramps/cli/plug/__init__.py b/gramps/cli/plug/__init__.py index 299bf0add..b1c1d37b1 100644 --- a/gramps/cli/plug/__init__.py +++ b/gramps/cli/plug/__init__.py @@ -88,9 +88,9 @@ def _convert_str_to_match_type(str_val, type_val): return str(str_val) elif ret_type == int: - if str_val.isdigit(): + try: return int(str_val) - else: + except ValueError: print("'%s' is not an integer number" % str_val) return 0