xrange deprecated in python3, change to range

thanks to Sumit Bhardwaj for the hint
This commit is contained in:
Christoph Holtermann
2018-09-22 18:12:11 +02:00
parent 97916c6682
commit 64a28b5263
2 changed files with 3 additions and 3 deletions

View File

@@ -129,7 +129,7 @@ def period_end(start_year, start_month, period_type):
def generate_period_boundaries(start_year, start_month, period_type, periods):
for i in xrange(periods):
for i in range(periods):
yield ( date(start_year, start_month, 1),
period_end(start_year, start_month, period_type) )
start_year, start_month = next_period_start(start_year, start_month,

View File

@@ -22,7 +22,7 @@
# @author Mark Jenkins, ParIT Worker Co-operative <mark@parit.ca>
# Opens a GnuCash book file and adds an invoice to it for a particular
# customer (by ID) with a specific ID and value
# customer (by ID) with a specific ID and value
# Optionally also adds a payment for the invoice as well
#
# The account tree and tax tables are assumed to be the same as the ones
@@ -67,7 +67,7 @@ def gnc_numeric_from_decimal(decimal_value):
numerator_place_value = 1
# add each digit to the final value multiplied by the place value
# from least significant to most sigificant
for i in xrange(len(digits)-1,-1,-1):
for i in range(len(digits)-1,-1,-1):
numerator += digits[i] * numerator_place_value
numerator_place_value *= TEN