From 8776ab1ff8b61d8469f444ef72825ee824f7ea88 Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Wed, 18 Dec 2013 22:11:21 +0100 Subject: [PATCH] Exception does not work with %s --- accounting/storage/ledgercli.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/accounting/storage/ledgercli.py b/accounting/storage/ledgercli.py index 9c2691f..d47064d 100644 --- a/accounting/storage/ledgercli.py +++ b/accounting/storage/ledgercli.py @@ -362,7 +362,8 @@ class Ledger(Storage): break if not semantic_lines['id_location']: - raise TransactionNotFound('No transaction with ID "%s" found') + raise TransactionNotFound( + 'No transaction with ID "{0}" found'.format(transaction_id)) transaction_start_pattern = re.compile(r'^\S') @@ -422,8 +423,8 @@ class Ledger(Storage): :data:`transaction` to the database. ''' if not transaction.id: - return AccountingException('The transaction %s has no' - ' id attribute', transaction) + return AccountingException(('The transaction {0} has no' + ' id attribute').format(transaction)) old_transaction = self.get_transaction(transaction.id)