From 566407d6f68e906946ff80648c2bde9024bda192 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 22 Jan 2020 15:55:36 +0100 Subject: [PATCH] Simpler definition of a custom exception class --- scripts/assemble_changelog.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/assemble_changelog.py b/scripts/assemble_changelog.py index 1e59bb0bc..bba2c39c4 100755 --- a/scripts/assemble_changelog.py +++ b/scripts/assemble_changelog.py @@ -28,11 +28,9 @@ import sys class InputFormatError(Exception): def __init__(self, filename, line_number, message, *args, **kwargs): - self.filename = filename - self.line_number = line_number - self.message = message.format(*args, **kwargs) - def __str__(self): - return '{}:{}: {}'.format(self.filename, self.line_number, self.message) + message = '{}:{}: {}'.format(filename, line_number, + message.format(*args, **kwargs)) + super().__init__(message) STANDARD_SECTIONS = ( b'Interface changes',