From c4d4310d801ccf20ea73717eb05ea27d4c6fbc62 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 28 Dec 2014 20:53:21 +0200 Subject: Remove trailing whitespace --- obnamlib/structurederror.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'obnamlib/structurederror.py') diff --git a/obnamlib/structurederror.py b/obnamlib/structurederror.py index 81c4d5a4..18c13e5a 100644 --- a/obnamlib/structurederror.py +++ b/obnamlib/structurederror.py @@ -123,10 +123,17 @@ class StructuredError(Exception): formatted_msg = '{0} (PROGRAMMING ERROR: {1} {2})'.format( dedented, repr(e), repr(self.kwargs)) - return '{0}: {1}'.format(self.id, formatted_msg) + formatted = '{0}: {1}'.format(self.id, formatted_msg) + return formatted.rstrip() def formatted(self): - '''Return the full formatted message.''' + '''Return the full formatted message. + + Note that the returned string will NOT end in whitespace. If + the format string ends in, say, a newline, it is stripped + away. + + ''' return self._format_msg(self.msg) def __str__(self): -- cgit v1.2.1