Mercurial > python-hglib
comparison hglib/util.py @ 153:ef8eb78fc88d
hglib: don't try to use long under Python 3 (issue4520)
author | Brett Cannon <brett@python.org> |
---|---|
date | Fri, 20 Mar 2015 16:34:42 -0400 |
parents | 0808bb03add5 |
children | 2104fc9aa513 |
comparison
equal
deleted
inserted
replaced
152:0808bb03add5 | 153:ef8eb78fc88d |
---|---|
5 except ImportError: | 5 except ImportError: |
6 from cStringIO import StringIO as BytesIO | 6 from cStringIO import StringIO as BytesIO |
7 | 7 |
8 if sys.version_info[0] > 2: | 8 if sys.version_info[0] > 2: |
9 izip = zip | 9 izip = zip |
10 integertypes = (int,) | |
10 | 11 |
11 def b(s): | 12 def b(s): |
12 """Encode the string as bytes.""" | 13 """Encode the string as bytes.""" |
13 return s.encode('latin-1') | 14 return s.encode('latin-1') |
14 else: | 15 else: |
15 from itertools import izip | 16 from itertools import izip |
17 integertypes = (long, int) | |
16 | 18 |
17 def b(s): | 19 def b(s): |
18 """Encode the string as bytes.""" | 20 """Encode the string as bytes.""" |
19 return s | 21 return s |
20 | 22 |