fix for python3

This commit is contained in:
Christoph Holtermann 2018-09-02 16:25:04 +02:00 committed by c-holtermann
parent df80796afe
commit 61f7613b8d
2 changed files with 8 additions and 7 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
##@file
@ -63,7 +63,7 @@ def main(argv=None):
try:
opts, args = getopt.getopt(argv[1:], "fhlI:t:o:", ["help"])
except getopt.error, msg:
except getopt.error as msg:
raise Usage(msg)
for opt in opts:
@ -105,12 +105,12 @@ def main(argv=None):
filename_output = filename_template + ".out"
print("no output filename given, will be:", filename_output)
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()

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
## @file
# @brief Add __str__ and __unicode__ methods to financial objects so that @code print object @endcode leads to human readable results
""" @package str_methods.py -- Add __str__ and __unicode__ methods to financial objects
@ -30,7 +30,8 @@
# * It seems useful to have an object for each modification. That is because there is some Initialisation to be done.
#
import gnucash, function_class
import gnucash
from gnucash import function_class
# Default values for encoding of strings in GnuCashs Database
DEFAULT_ENCODING = "UTF-8"