From e1bba5d977a8b9385e9ffdb05861833485003d23 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Wed, 27 Jan 2016 10:44:41 +0100 Subject: Make tests scripts Python 3 compatible --- test/regress/78AB4B87.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'test/regress/78AB4B87.py') diff --git a/test/regress/78AB4B87.py b/test/regress/78AB4B87.py index fed95b54..affc3496 100644 --- a/test/regress/78AB4B87.py +++ b/test/regress/78AB4B87.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import ledger eur = ledger.commodities.find_or_create('EUR') @@ -7,8 +9,8 @@ total_gbp = ledger.Amount("0.00 GBP") total = ledger.Amount("0.00 EUR") for post in ledger.read_journal("test/regress/78AB4B87.dat").query("^income:"): - print post.amount - print post.amount.commodity + print(post.amount) + print(post.amount.commodity) if post.amount.commodity == "EUR": total_eur += post.amount elif post.amount.commodity == "GBP": @@ -16,12 +18,12 @@ for post in ledger.read_journal("test/regress/78AB4B87.dat").query("^income:"): a = post.amount.value(eur) if a: - print "Total is presently: (%s)" % total - print "Converted to EUR: (%s)" % a + print("Total is presently: (%s)" % total) + print("Converted to EUR: (%s)" % a) total += a - print "Total is now: (%s)" % total + print("Total is now: (%s)" % total) else: - print "Cannot convert '%s'" % post.amount - print + print("Cannot convert '%s'" % post.amount) + print() -print total +print(total) -- cgit v1.2.3