Skip to content

Commit

Permalink
Use named keyword args in format.
Browse files Browse the repository at this point in the history
Resolves a flake8 error which would manifest as a KeyError at runtime
when this exception is created.
  • Loading branch information
nuclearsandwich committed Apr 10, 2020
1 parent d40f10d commit 5c0a95a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rclpy/rclpy/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ class ParameterException(Exception):
"""Base exception for parameter-related errors."""

def __init__(self, error_msg, parameters, *args):
Exception.__init__(self, '{error_msg}: {parameters}'.format(error_msg, parameters), *args)
Exception.__init__(self, '{error_msg}: {parameters}'.format(
error_msg=error_msg, parameters=parameters), *args)


class ParameterNotDeclaredException(ParameterException):
Expand Down

0 comments on commit 5c0a95a

Please sign in to comment.