From 5c0a95a9506691c22c43caae83289d543daeb588 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. Resolves a flake8 error which would manifest as a KeyError at runtime when this exception is created. --- 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):