chiark
/
gitweb
/
~mdw
/
stgit
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7cb253c
)
Return None instead of crashing on undefined integer config items
author
Karl Hasselström
<kha@treskal.com>
Mon, 12 Jan 2009 20:04:10 +0000
(21:04 +0100)
committer
Karl Hasselström
<kha@treskal.com>
Mon, 12 Jan 2009 20:04:10 +0000
(21:04 +0100)
Signed-off-by: Karl Hasselström <kha@treskal.com>
stgit/config.py
patch
|
blob
|
blame
|
history
diff --git
a/stgit/config.py
b/stgit/config.py
index 89344454c181fc5fb6448213bad28954b6691204..5b47580878b99de04a2ffdbd588ac12667681c08 100644
(file)
--- a/
stgit/config.py
+++ b/
stgit/config.py
@@
-65,7
+65,9
@@
class GitConfig:
def getint(self, name):
value = self.get(name)
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)
return int(value)
else:
raise GitConfigException, 'Value for "%s" is not an integer: "%s"' % (name, value)