Merge Christoph Holterman's 'PR-python2to3fixes' into maint.

This commit is contained in:
John Ralls 2018-10-16 09:37:25 -07:00
commit d9ed847595
6 changed files with 24 additions and 24 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# account_analysis.py -- Output all the credits and debits on an account
#
@ -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

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
## @file
# @brief Recurse over all accounts in a book and marks the first one having target_account_code as tax related

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
##@file

View File

@ -179,7 +179,7 @@ def main(argv=None):
try:
opts, args = getopt.getopt(argv[1:], "fhiln:po:", ["help"])
except getopt.error, msg:
except getopt.error as msg:
raise Usage(msg)
for opt in opts:
@ -207,12 +207,12 @@ def main(argv=None):
if len(args)==0:
raise Usage("No input given !")
input_url = args[0]
except Usage, err:
except Usage as err:
if err.msg == "Help:":
retcode=0
else:
print(>>sys.stderr, "Error:",err.msg)
print(>>sys.stderr, "for help use --help")
print("Error:", err.msg, file=sys.stderr)
print("for help use --help", file=sys.stderr)
retcode=2
print("Generate a LaTeX invoice or print out all invoices.")

View File

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

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# test_imbalance_transaction.py -- Test the transaction imbalace viewing
# mechanisms