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

  • Committer: Jelmer Vernooij
  • Date: 2020-08-10 15:00:17 UTC
  • mfrom: (7490.40.99 work)
  • mto: This revision was merged to the branch mainline in revision 7521.
  • Revision ID: jelmer@jelmer.uk-20200810150017-vs7xnrd1vat4iktg
Merge lp:brz/3.1.

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
import sys
21
19
 
22
20
 
144
142
encode_func = {}
145
143
encode_func[type(Bencached(0))] = encode_bencached
146
144
encode_func[int] = encode_int
147
 
if sys.version_info < (3,):
148
 
    encode_func[long] = encode_int
149
 
    int_to_bytes = str
150
 
else:
151
 
    def int_to_bytes(n):
152
 
        return b'%d' % n
 
145
def int_to_bytes(n):
 
146
    return b'%d' % n
153
147
encode_func[bytes] = encode_string
154
148
encode_func[list] = encode_list
155
149
encode_func[tuple] = encode_list