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 1717#
1818# ------------------------------------------------------------------------
1919
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+
2129try :
2230 import gzip
2331except ImportError :
2432 gzip = None #python can be built without zlib/gzip support
2533
2634
27- class ProxiedTransport (xmlrpclib . Transport ):
35+ class ProxiedTransport (Transport ):
2836 def __init__ (self ):
29- xmlrpclib .Transport .__init__ (self )
37+ if IS_PY3 :
38+ super (ProxiedTransport , self ).__init__ ()
39+ else :
40+ Transport .__init__ (self )
3041 self .realhost = None
3142 self .proxy = None
3243
@@ -61,7 +72,7 @@ def make_connection(self, host):
6172 else :
6273 self ._extra_headers = auth
6374 self .realhost = host
64- self ._connection = host , httplib . HTTPConnection (self .proxy )
75+ self ._connection = host , HTTPConnection (self .proxy )
6576 return self ._connection [1 ]
6677
6778 def send_request (self , connection , handler , request_body ):
You can’t perform that action at this time.
0 commit comments