/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-05-06 03:06:18 UTC
  • mfrom: (7500.1.2 trunk-merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200506030618-131sjbc876q7on66
Merge the 3.1 branch.

Merged from https://code.launchpad.net/~jelmer/brz/trunk-merge-3.1/+merge/383481

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