git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] stgit namelength is an integer

From
Karl Hasselström <kha@treskal.com>
Date
Jan 12, 2009, 20:13 UTC
Message-ID
<20090112201309.GA32588@diana.vm.bytemark.co.uk>
In-Reply-To
<20090105190354.GA8295@osc.edu>
Thanks, but the test suite fails unless I apply this first:
    Return None instead of crashing on undefined integer config items
    Signed-off-by: Karl Hasselström <kha@treskal.com>
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)
-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Previous: Pete Wyckoff
Message 2 of 2 in “stgit namelength is an integer”
  1. stgit namelength is an integerPete Wyckoff, Jan 5, 2009
  2. Karl HasselströmJan 12, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.