/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 brzlib/util/_bencode_py.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 14:47:52 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521144752-8o6jt0a6xat9g7lm
More renames; commands in output, environment variables.

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
154
157
        encode_int(int(x), r)
155
158
    encode_func[BooleanType] = encode_bool
156
159
 
157
 
from bzrlib._static_tuple_py import StaticTuple
 
160
from brzlib._static_tuple_py import StaticTuple
158
161
encode_func[StaticTuple] = encode_list
159
162
try:
160
 
    from bzrlib._static_tuple_c import StaticTuple
 
163
    from brzlib._static_tuple_c import StaticTuple
161
164
except ImportError:
162
165
    pass
163
166
else: