/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: 2019-03-05 07:32:38 UTC
  • mto: (7290.1.21 work)
  • mto: This revision was merged to the branch mainline in revision 7311.
  • Revision ID: jelmer@jelmer.uk-20190305073238-zlqn981opwnqsmzi
Add appveyor configuration.

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