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)