File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 17
17
#
18
18
# ------------------------------------------------------------------------
19
19
20
- import xmlrpclib , httplib
20
+ import sys
21
+ IS_PY3 = sys .version_info [0 ] > 2
22
+ if IS_PY3 :
23
+ from xmlrpc .client import Transport
24
+ from http .client import HTTPConnection
25
+ else :
26
+ from xmlrpclib import Transport
27
+ from httplib import HTTPConnection
28
+
21
29
try :
22
30
import gzip
23
31
except ImportError :
24
32
gzip = None #python can be built without zlib/gzip support
25
33
26
34
27
- class ProxiedTransport (xmlrpclib . Transport ):
35
+ class ProxiedTransport (Transport ):
28
36
def __init__ (self ):
29
- xmlrpclib .Transport .__init__ (self )
37
+ if IS_PY3 :
38
+ super (ProxiedTransport , self ).__init__ ()
39
+ else :
40
+ Transport .__init__ (self )
30
41
self .realhost = None
31
42
self .proxy = None
32
43
@@ -61,7 +72,7 @@ def make_connection(self, host):
61
72
else :
62
73
self ._extra_headers = auth
63
74
self .realhost = host
64
- self ._connection = host , httplib . HTTPConnection (self .proxy )
75
+ self ._connection = host , HTTPConnection (self .proxy )
65
76
return self ._connection [1 ]
66
77
67
78
def send_request (self , connection , handler , request_body ):
You can’t perform that action at this time.
0 commit comments