git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
the PLCAPI class requires __construct as well in order to move to php8
[plcapi.git]
/
PLC
/
PyCurl.py
diff --git
a/PLC/PyCurl.py
b/PLC/PyCurl.py
index
4ae2fdc
..
c8a3911
100644
(file)
--- a/
PLC/PyCurl.py
+++ b/
PLC/PyCurl.py
@@
-7,14
+7,14
@@
#
import os
#
import os
-import xmlrpc
lib
+import xmlrpc
.client
import pycurl
from tempfile import NamedTemporaryFile
import pycurl
from tempfile import NamedTemporaryFile
-class PyCurlTransport(xmlrpc
lib
.Transport):
+class PyCurlTransport(xmlrpc
.client
.Transport):
def __init__(self, uri, cert = None, timeout = 300):
def __init__(self, uri, cert = None, timeout = 300):
- if hasattr(xmlrpc
lib
.Transport,'__init__'):
- xmlrpc
lib
.Transport.__init__(self)
+ if hasattr(xmlrpc
.client
.Transport,'__init__'):
+ xmlrpc
.client
.Transport.__init__(self)
self.curl = pycurl.Curl()
# Suppress signals
self.curl = pycurl.Curl()
# Suppress signals
@@
-65,13
+65,13
@@
class PyCurlTransport(xmlrpclib.Transport):
response = self.body
self.body = ""
errmsg="<no known errmsg>"
response = self.body
self.body = ""
errmsg="<no known errmsg>"
- except pycurl.error
,
err:
+ except pycurl.error
as
err:
(errcode, errmsg) = err
if errcode == 60:
(errcode, errmsg) = err
if errcode == 60:
- raise Exception
, "PyCurl: SSL certificate validation failed"
+ raise Exception
("PyCurl: SSL certificate validation failed")
elif errcode != 200:
elif errcode != 200:
- raise Exception
, "PyCurl: HTTP error %d -- %r" % (errcode,errmsg
)
+ raise Exception
("PyCurl: HTTP error %d -- %r" % (errcode,errmsg)
)
# Parse response
p, u = self.getparser()
# Parse response
p, u = self.getparser()