Rev 5204: (garyvdm for gz) Include OverflowError in error types bencode in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue May 4 19:50:57 BST 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5204 [merge]
revision-id: pqm at pqm.ubuntu.com-20100504185054-jhfzap78g3lxtj7u
parent: pqm at pqm.ubuntu.com-20100504173248-nksnwwqdg0xki8r2
parent: gzlist at googlemail.com-20100503205739-n326zdvevv0rmruh
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2010-05-04 19:50:54 +0100
message:
  (garyvdm for gz) Include OverflowError in error types bencode
  	translates,
  	as Python 2.4 raises that rather than IndexError in some situations
modified:
  bzrlib/util/_bencode_py.py     bencode.py-20070220044742-sltr28q21w2wzlxi-1
=== modified file 'bzrlib/util/_bencode_py.py'
--- a/bzrlib/util/_bencode_py.py	2009-12-01 19:44:12 +0000
+++ b/bzrlib/util/_bencode_py.py	2010-05-03 20:57:39 +0000
@@ -90,8 +90,9 @@
             raise TypeError
         try:
             r, l = self.decode_func[x[0]](x, 0)
-        except (IndexError, KeyError):
-            raise ValueError
+        except (IndexError, KeyError, OverflowError), e:
+            import sys
+            raise ValueError, ValueError(str(e)), sys.exc_info()[2]
         if l != len(x):
             raise ValueError
         return r




More information about the bazaar-commits mailing list