summaryrefslogtreecommitdiffstats
path: root/Tools/i18n/msgfmt.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/i18n/msgfmt.py')
-rwxr-xr-xTools/i18n/msgfmt.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Tools/i18n/msgfmt.py b/Tools/i18n/msgfmt.py
index c2f39a1..f4466b4 100755
--- a/Tools/i18n/msgfmt.py
+++ b/Tools/i18n/msgfmt.py
@@ -38,9 +38,9 @@ MESSAGES = {}
def usage(code, msg=''):
- print >> sys.stderr, __doc__
+ print(__doc__, file=sys.stderr)
if msg:
- print >> sys.stderr, msg
+ print(msg, file=sys.stderr)
sys.exit(code)
@@ -111,7 +111,7 @@ def make(filename, outfile):
try:
lines = open(infile).readlines()
except IOError as msg:
- print >> sys.stderr, msg
+ print(msg, file=sys.stderr)
sys.exit(1)
section = None
@@ -154,9 +154,9 @@ def make(filename, outfile):
elif section == STR:
msgstr += l
else:
- print >> sys.stderr, 'Syntax error on %s:%d' % (infile, lno), \
- 'before:'
- print >> sys.stderr, l
+ print('Syntax error on %s:%d' % (infile, lno), \
+ 'before:', file=sys.stderr)
+ print(l, file=sys.stderr)
sys.exit(1)
# Add last entry
if section == STR:
@@ -168,7 +168,7 @@ def make(filename, outfile):
try:
open(outfile,"wb").write(output)
except IOError as msg:
- print >> sys.stderr, msg
+ print(msg, file=sys.stderr)
@@ -185,14 +185,14 @@ def main():
if opt in ('-h', '--help'):
usage(0)
elif opt in ('-V', '--version'):
- print >> sys.stderr, "msgfmt.py", __version__
+ print("msgfmt.py", __version__, file=sys.stderr)
sys.exit(0)
elif opt in ('-o', '--output-file'):
outfile = arg
# do it
if not args:
- print >> sys.stderr, 'No input file given'
- print >> sys.stderr, "Try `msgfmt --help' for more information."
+ print('No input file given', file=sys.stderr)
+ print("Try `msgfmt --help' for more information.", file=sys.stderr)
return
for filename in args: