~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/util/_bencode_py.py

  • Committer: Vincent Ladeuil
  • Date: 2010-03-10 09:33:04 UTC
  • mto: (5082.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5083.
  • Revision ID: v.ladeuil+lp@free.fr-20100310093304-4245t4tazd4sxoav
Cleanup test from overly cautious checks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#
16
16
# Modifications copyright (C) 2008 Canonical Ltd
17
17
 
18
 
from __future__ import absolute_import
19
 
 
20
18
class BDecoder(object):
21
19
 
22
20
    def __init__(self, yield_tuples=False):
92
90
            raise TypeError
93
91
        try:
94
92
            r, l = self.decode_func[x[0]](x, 0)
95
 
        except (IndexError, KeyError, OverflowError), e:
96
 
            import sys
97
 
            raise ValueError, ValueError(str(e)), sys.exc_info()[2]
 
93
        except (IndexError, KeyError):
 
94
            raise ValueError
98
95
        if l != len(x):
99
96
            raise ValueError
100
97
        return r