##// END OF EJS Templates
pycompat: remove first not ispy3 block...
Gregory Szorc -
r49724:57b58413 default
parent child Browse files
Show More
@@ -10,13 +10,21 b' This contains aliases to hide python ver'
10
10
11 from __future__ import absolute_import
11 from __future__ import absolute_import
12
12
13 import builtins
14 import concurrent.futures as futures
13 import getopt
15 import getopt
16 import http.client as httplib
17 import http.cookiejar as cookielib
14 import inspect
18 import inspect
15 import json
19 import json
16 import os
20 import os
21 import pickle
22 import queue
17 import shlex
23 import shlex
24 import socketserver
18 import sys
25 import sys
19 import tempfile
26 import tempfile
27 import xmlrpc.client as xmlrpclib
20
28
21 ispy3 = sys.version_info[0] >= 3
29 ispy3 = sys.version_info[0] >= 3
22 ispypy = '__pypy__' in sys.builtin_module_names
30 ispypy = '__pypy__' in sys.builtin_module_names
@@ -27,32 +35,11 b' if not globals(): # hide this from non-'
27
35
28 TYPE_CHECKING = typing.TYPE_CHECKING
36 TYPE_CHECKING = typing.TYPE_CHECKING
29
37
30 if not ispy3:
31 import cookielib
32 import cPickle as pickle
33 import httplib
34 import Queue as queue
35 import SocketServer as socketserver
36 import xmlrpclib
37
38 def future_set_exception_info(f, exc_info):
39 f.set_exception_info(*exc_info)
40
41 # this is close enough for our usage
42 FileNotFoundError = OSError
43
44 else:
45 import builtins
46 import http.cookiejar as cookielib
47 import http.client as httplib
48 import pickle
49 import queue as queue
50 import socketserver
51 import xmlrpc.client as xmlrpclib
52
38
53 def future_set_exception_info(f, exc_info):
39 def future_set_exception_info(f, exc_info):
54 f.set_exception(exc_info[0])
40 f.set_exception(exc_info[0])
55
41
42
56 FileNotFoundError = builtins.FileNotFoundError
43 FileNotFoundError = builtins.FileNotFoundError
57
44
58
45
General Comments 0
You need to be logged in to leave comments. Login now