/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

Support user.signingkey configuration variable in .git/config.

Merged from https://code.launchpad.net/~jelmer/brz/local-git-key/+merge/381000

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