diff options
author | Florian Weimer <fw@deneb.enyo.de> | 2008-11-23 18:07:13 +0000 |
---|---|---|
committer | Florian Weimer <fw@deneb.enyo.de> | 2008-11-23 18:07:13 +0000 |
commit | e2b1084ddc3c7e3fa2f67ef72d4f1cdc4d2b5de8 (patch) | |
tree | 4e53ea878a6e95d62f21f6bd66b8517010980a7e /lib/python/bugs.py | |
parent | fbcfa6398f33212a87569482d0ceaf161dfa1df3 (diff) |
lib/python/bugs.py: Replace integer type asserts to with int conversion
The reason is that even in Python 2.5, numeric objects fluctuate
between int and long types.
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@10465 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'lib/python/bugs.py')
-rw-r--r-- | lib/python/bugs.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/python/bugs.py b/lib/python/bugs.py index 89d75269b9..72422a2741 100644 --- a/lib/python/bugs.py +++ b/lib/python/bugs.py @@ -35,6 +35,11 @@ def internUrgency(name, urgencies=listUrgencies()): return None del listUrgencies +def to_integer(expr): + ei = int(expr) + assert ei == expr, expr + return ei + class PackageNote: """A package note. @@ -95,10 +100,10 @@ class PackageNote: assert False def loadBugs(self, cursor): - assert type(self.id) == types.IntType, self.id + id = to_integer(self.id) assert len(self.bugs) == 0 for (b,) in cursor.execute\ - ("SELECT bug FROM debian_bugs WHERE note = ?", (self.id,)): + ("SELECT bug FROM debian_bugs WHERE note = ?", (id,)): self.bugs.append(int(b)) def merge(self, other): @@ -184,7 +189,7 @@ class BugBase: def __init__(self, fname, lineno, date, name, description, comments): assert type(fname) in types.StringTypes - assert type(lineno) == types.IntType + lineno = to_integer(lineno) self.source_file = fname self.source_line = lineno self.date = date |