if isinstance(value, Type):
f(*args)
return
- raise TypeError, "cannot marshal %s objects" % type(value)
+ raise TypeError("cannot marshal %s objects" % type(value))
else:
f(*args)
"""
# Look up method
if method not in self.methods:
- raise SfaInvalidAPIMethod, method
+ raise SfaInvalidAPIMethod(method)
# Get new instance of method
try:
return getattr(module, classname)(self)
except (ImportError, AttributeError):
self.logger.log_exc("Error importing method: %s" % method)
- raise SfaInvalidAPIMethod, method
+ raise SfaInvalidAPIMethod(method)
def call(self, source, method, *args):
"""
method = method_map[method]
methodresponse = True
- except Exception, e:
+ except Exception as e:
if SOAPpy is not None:
self.protocol = 'soap'
interface = SOAPpy
try:
result = self.call(source, method, *args)
- except SfaFault, fault:
+ except SfaFault as fault:
result = fault
self.logger.log_exc("XmlrpcApi.handle has caught Exception")
- except Exception, fault:
+ except Exception as fault:
self.logger.log_exc("XmlrpcApi.handle has caught Exception")
result = SfaAPIError(fault)