diff --git a/src/hs/admin/api/api.py b/src/hs/admin/api/api.py index 3ea3cc7..bcba80d 100644 --- a/src/hs/admin/api/api.py +++ b/src/hs/admin/api/api.py @@ -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 diff --git a/src/hs/admin/api/proxy.py b/src/hs/admin/api/proxy.py index 8dadd60..0ee380d 100644 --- a/src/hs/admin/api/proxy.py +++ b/src/hs/admin/api/proxy.py @@ -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