From: Karl Hasselström Date: Mon, 12 Jan 2009 20:04:10 +0000 (+0100) Subject: Return None instead of crashing on undefined integer config items X-Git-Tag: v0.15-rc1~49^2~2 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/e928a3ec866f51a811299d2978f5e3d3b2c13819 Return None instead of crashing on undefined integer config items Signed-off-by: Karl Hasselström --- diff --git a/stgit/config.py b/stgit/config.py index 8934445..5b47580 100644 --- a/stgit/config.py +++ b/stgit/config.py @@ -65,7 +65,9 @@ class GitConfig: def getint(self, name): value = self.get(name) - if value.isdigit(): + if value == None: + return None + elif value.isdigit(): return int(value) else: raise GitConfigException, 'Value for "%s" is not an integer: "%s"' % (name, value)