python3 does not return list of keys

This commit is contained in:
c-holtermann 2019-04-04 17:30:44 +02:00
parent 64a01f3027
commit 77727ffc49
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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)