##// END OF EJS Templates
pycompat: provide 'ispy3' constant...
Yuya Nishihara -
r30030:0f6d6fdd default
parent child Browse files
Show More
@@ -159,6 +159,7 b' from . import ('
159 159 error,
160 160 obsolete,
161 161 pushkey,
162 pycompat,
162 163 tags,
163 164 url,
164 165 util,
@@ -996,7 +997,7 b' class bundlepart(object):'
996 997 outdebug(ui, 'closing payload chunk')
997 998 # abort current part payload
998 999 yield _pack(_fpayloadsize, 0)
999 if sys.version_info[0] >= 3:
1000 if pycompat.ispy3:
1000 1001 raise exc_info[0](exc_info[1]).with_traceback(exc_info[2])
1001 1002 else:
1002 1003 exec("""raise exc_info[0], exc_info[1], exc_info[2]""")
@@ -10,14 +10,14 b' from __future__ import absolute_import'
10 10 import array
11 11 import locale
12 12 import os
13 import sys
14 13 import unicodedata
15 14
16 15 from . import (
17 16 error,
17 pycompat,
18 18 )
19 19
20 if sys.version_info[0] >= 3:
20 if pycompat.ispy3:
21 21 unichr = chr
22 22
23 23 # These unicode characters are ignored by HFS+ (Apple Technote 1150,
@@ -27,7 +27,7 b' if sys.version_info[0] >= 3:'
27 27 "200c 200d 200e 200f 202a 202b 202c 202d 202e "
28 28 "206a 206b 206c 206d 206e 206f feff".split()]
29 29 # verify the next function will work
30 if sys.version_info[0] >= 3:
30 if pycompat.ispy3:
31 31 assert set(i[0] for i in _ignore) == set([ord(b'\xe2'), ord(b'\xef')])
32 32 else:
33 33 assert set(i[0] for i in _ignore) == set(["\xe2", "\xef"])
@@ -12,7 +12,9 b' from __future__ import absolute_import'
12 12
13 13 import sys
14 14
15 if sys.version_info[0] < 3:
15 ispy3 = (sys.version_info[0] >= 3)
16
17 if not ispy3:
16 18 import cPickle as pickle
17 19 import cStringIO as io
18 20 import httplib
@@ -29,7 +31,7 b' else:'
29 31 import urllib.parse as urlparse
30 32 import xmlrpc.client as xmlrpclib
31 33
32 if sys.version_info[0] >= 3:
34 if ispy3:
33 35 import builtins
34 36 import functools
35 37
@@ -72,7 +74,7 b' class _pycompatstub(object):'
72 74 httpserver = _pycompatstub()
73 75 urlreq = _pycompatstub()
74 76 urlerr = _pycompatstub()
75 if sys.version_info[0] < 3:
77 if not ispy3:
76 78 import BaseHTTPServer
77 79 import CGIHTTPServer
78 80 import SimpleHTTPServer
@@ -232,7 +232,7 b' class digestchecker(object):'
232 232 try:
233 233 buffer = buffer
234 234 except NameError:
235 if sys.version_info[0] < 3:
235 if not pycompat.ispy3:
236 236 def buffer(sliceable, offset=0):
237 237 return sliceable[offset:]
238 238 else:
General Comments 0
You need to be logged in to leave comments. Login now