##// END OF EJS Templates
pycompat: move imports of cStringIO/io to where they are used...
Yuya Nishihara -
r31372:06440ba0 default
parent child Browse files
Show More
@@ -19,7 +19,6 b' ispy3 = (sys.version_info[0] >= 3)'
19
19
20 if not ispy3:
20 if not ispy3:
21 import cPickle as pickle
21 import cPickle as pickle
22 import cStringIO as io
23 import httplib
22 import httplib
24 import Queue as _queue
23 import Queue as _queue
25 import SocketServer as socketserver
24 import SocketServer as socketserver
@@ -28,7 +27,6 b' if not ispy3:'
28 import xmlrpclib
27 import xmlrpclib
29 else:
28 else:
30 import http.client as httplib
29 import http.client as httplib
31 import io
32 import pickle
30 import pickle
33 import queue as _queue
31 import queue as _queue
34 import socketserver
32 import socketserver
@@ -39,6 +37,8 b' else:'
39 if ispy3:
37 if ispy3:
40 import builtins
38 import builtins
41 import functools
39 import functools
40 import io
41
42 fsencode = os.fsencode
42 fsencode = os.fsencode
43 fsdecode = os.fsdecode
43 fsdecode = os.fsdecode
44 # A bytes version of os.name.
44 # A bytes version of os.name.
@@ -139,6 +139,8 b' if ispy3:'
139 return [a.encode('latin-1') for a in ret]
139 return [a.encode('latin-1') for a in ret]
140
140
141 else:
141 else:
142 import cStringIO
143
142 bytechr = chr
144 bytechr = chr
143
145
144 def sysstr(s):
146 def sysstr(s):
@@ -181,7 +183,7 b' else:'
181 getcwd = os.getcwd
183 getcwd = os.getcwd
182 sysexecutable = sys.executable
184 sysexecutable = sys.executable
183 shlexsplit = shlex.split
185 shlexsplit = shlex.split
184 stringio = io.StringIO
186 stringio = cStringIO.StringIO
185
187
186 empty = _queue.Empty
188 empty = _queue.Empty
187 queue = _queue.Queue
189 queue = _queue.Queue
General Comments 0
You need to be logged in to leave comments. Login now