/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/util/_bencode_py.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-29 21:05:11 UTC
  • mto: This revision was merged to the branch mainline in revision 6406.
  • Revision ID: jelmer@samba.org-20111229210511-2hfcqpkn001cwzn1
Fix 'bzr shell-complete' and add a really basic test for it.

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
 
18
20
class BDecoder(object):
19
21
 
20
22
    def __init__(self, yield_tuples=False):
90
92
            raise TypeError
91
93
        try:
92
94
            r, l = self.decode_func[x[0]](x, 0)
93
 
        except (IndexError, KeyError):
94
 
            raise ValueError
 
95
        except (IndexError, KeyError, OverflowError), e:
 
96
            import sys
 
97
            raise ValueError, ValueError(str(e)), sys.exc_info()[2]
95
98
        if l != len(x):
96
99
            raise ValueError
97
100
        return r