From 59f594d03aa351db4d2291bdcc92ee7f6b55b253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven!=20Ragnar=C3=B6k?= Date: Fri, 10 Apr 2020 10:10:36 -0400 Subject: [PATCH] Use named keyword args in format. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves a flake8 error which would manifest as a KeyError at runtime when this exception is created. Signed-off-by: Steven! Ragnarök --- rclpy/rclpy/exceptions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rclpy/rclpy/exceptions.py b/rclpy/rclpy/exceptions.py index c4b1baca8..0ecdc6235 100644 --- a/rclpy/rclpy/exceptions.py +++ b/rclpy/rclpy/exceptions.py @@ -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):