getting rid of Py2.6 DeprecationWarnings
This commit is contained in:
parent
8f36a9299a
commit
8fb9113225
|
@ -148,8 +148,8 @@ def apivalidate(error_return_value, validators=()):
|
|||
try:
|
||||
newArgs.append(v(a, caller_id))
|
||||
except ParameterInvalid, e:
|
||||
_logger.error("%s: invalid parameter: %s", f.func_name, e.message or 'error')
|
||||
return -1, e.message or 'error', error_return_value
|
||||
_logger.error("%s: invalid parameter: %s", f.func_name, str(e) or 'error')
|
||||
return -1, str(e) or 'error', error_return_value
|
||||
else:
|
||||
newArgs.append(a)
|
||||
|
||||
|
|
|
@ -41,10 +41,10 @@ ROSRPC = "rosrpc://"
|
|||
class ParameterInvalid(Exception):
|
||||
"""Exception that is raised when a parameter fails validation checks"""
|
||||
def __init__(self, message):
|
||||
self.message = message
|
||||
self._message = message
|
||||
|
||||
def __str__(self):
|
||||
return str(self.message)
|
||||
return str(self._message)
|
||||
|
||||
def non_empty(param_name):
|
||||
"""Validator that checks that parameter is not empty"""
|
||||
|
|
Loading…
Reference in New Issue