From 77727ffc49aeaedb9368fe5161d6fab1a108ca0b Mon Sep 17 00:00:00 2001 From: c-holtermann Date: Thu, 4 Apr 2019 17:30:44 +0200 Subject: [PATCH] python3 does not return list of keys --- bindings/python/example_scripts/account_analysis.py | 2 +- bindings/python/example_scripts/rest-api/gnucash_rest.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/python/example_scripts/account_analysis.py b/bindings/python/example_scripts/account_analysis.py index b7e59966a6..bbe6532f71 100644 --- a/bindings/python/example_scripts/account_analysis.py +++ b/bindings/python/example_scripts/account_analysis.py @@ -117,7 +117,7 @@ def next_period_start(start_year, start_month, period_type): def period_end(start_year, start_month, period_type): if period_type not in PERIODS: raise Exception("%s is not a valid period, should be %s" % ( - period_type, str(PERIODS.keys()) ) ) + period_type, str(list(PERIODS.keys())) ) ) end_year, end_month = next_period_start(start_year, start_month, period_type) diff --git a/bindings/python/example_scripts/rest-api/gnucash_rest.py b/bindings/python/example_scripts/rest-api/gnucash_rest.py index a7a54f2b5d..307d3d8312 100644 --- a/bindings/python/example_scripts/rest-api/gnucash_rest.py +++ b/bindings/python/example_scripts/rest-api/gnucash_rest.py @@ -843,7 +843,7 @@ def getSubAccounts(account): flat_accounts = [] - if 'subaccounts' in account.keys(): + if 'subaccounts' in list(account.keys()): for n, subaccount in enumerate(account['subaccounts']): flat_accounts.append(subaccount) flat_accounts = flat_accounts + getSubAccounts(subaccount)