summaryrefslogtreecommitdiffstats
path: root/Tools/i18n/msgfmt.py
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-08-03 17:06:41 (GMT)
committerCollin Winter <collinw@gmail.com>2007-08-03 17:06:41 (GMT)
commit6afaeb757af0dbd8508a0f2352ade61e41bec84c (patch)
treef1b31bc7138b17ff39791bbb45aa81583c3b6e46 /Tools/i18n/msgfmt.py
parente5d0e8431f929cad2da77b63fe1b7dc0ff21a428 (diff)
downloadcpython-6afaeb757af0dbd8508a0f2352ade61e41bec84c.zip
cpython-6afaeb757af0dbd8508a0f2352ade61e41bec84c.tar.gz
cpython-6afaeb757af0dbd8508a0f2352ade61e41bec84c.tar.bz2
Convert print statements to function calls in Tools/.
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: