Achieve Python 2/3 compatibility.
This commit is contained in:
parent
a85e289927
commit
79cc5c7d40
@ -1,7 +1,10 @@
|
||||
""" This module provides a class that implements the HSAdmin API.
|
||||
"""
|
||||
|
||||
from xmlrpclib import ServerProxy
|
||||
try:
|
||||
from xmlrpclib import ServerProxy
|
||||
except ImportError:
|
||||
from xmlrpc.client import ServerProxy
|
||||
|
||||
from .dispatcher import Dispatcher
|
||||
from .session import Session
|
||||
@ -30,7 +33,7 @@ class API(object):
|
||||
modules[module] = backend
|
||||
meta[backend][module] = dict()
|
||||
for prop in [prop for prop in props
|
||||
if prop.has_key('module') and (prop['module'] == module)]:
|
||||
if ('module' in prop) and (prop['module'] == module)]:
|
||||
del prop['module']
|
||||
meta[backend][module][prop['name']] = prop
|
||||
|
||||
|
@ -1,8 +1,12 @@
|
||||
""" This module provides a directly callable class that implements a remote method invokation.
|
||||
"""
|
||||
|
||||
from xmlrpclib import ServerProxy
|
||||
from xmlrpclib import Fault
|
||||
try:
|
||||
from xmlrpclib import ServerProxy
|
||||
from xmlrpclib import Fault
|
||||
except ImportError:
|
||||
from xmlrpc.client import ServerProxy
|
||||
from xmlrpc.client import Fault
|
||||
|
||||
from .exceptions import ProxyError
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user