summaryrefslogtreecommitdiffstats
path: root/Tools/i18n
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-05-16 17:02:34 (GMT)
committerGeorg Brandl <georg@python.org>2008-05-16 17:02:34 (GMT)
commitbf82e374ee737992235cbe944c9ddbd58236a892 (patch)
treef8c8dccaa76d58f9cb7d8cc0abb1355be75ee369 /Tools/i18n
parentacbca71ea775fc488bead0876d0cdbd48670dcbc (diff)
downloadcpython-bf82e374ee737992235cbe944c9ddbd58236a892.zip
cpython-bf82e374ee737992235cbe944c9ddbd58236a892.tar.gz
cpython-bf82e374ee737992235cbe944c9ddbd58236a892.tar.bz2
More 2to3 fixes in the Tools directory. Fixes #2893.
Diffstat (limited to 'Tools/i18n')
-rw-r--r--Tools/i18n/makelocalealias.py12
-rwxr-xr-xTools/i18n/msgfmt.py3
-rwxr-xr-xTools/i18n/pygettext.py2
3 files changed, 6 insertions, 11 deletions
diff --git a/Tools/i18n/makelocalealias.py b/Tools/i18n/makelocalealias.py
index f97b80e..45876c1 100644
--- a/Tools/i18n/makelocalealias.py
+++ b/Tools/i18n/makelocalealias.py
@@ -45,18 +45,14 @@ def parse(filename):
return data
def pprint(data):
-
- items = data.items()
- items.sort()
- for k,v in items:
+ items = sorted(data.items())
+ for k, v in items:
print(' %-40s%r,' % ('%r:' % k, v))
def print_differences(data, olddata):
-
- items = olddata.items()
- items.sort()
+ items = sorted(olddata.items())
for k, v in items:
- if not data.has_key(k):
+ if k not in data:
print('# removed %r' % k)
elif olddata[k] != data[k]:
print('# updated %r -> %r to %r' % \
diff --git a/Tools/i18n/msgfmt.py b/Tools/i18n/msgfmt.py
index f4466b4..860e4ea 100755
--- a/Tools/i18n/msgfmt.py
+++ b/Tools/i18n/msgfmt.py
@@ -56,9 +56,8 @@ def add(id, str, fuzzy):
def generate():
"Return the generated output."
global MESSAGES
- keys = MESSAGES.keys()
# the keys are sorted in the .mo file
- keys.sort()
+ keys = sorted(MESSAGES.keys())
offsets = []
ids = strs = ''
for id in keys:
diff --git a/Tools/i18n/pygettext.py b/Tools/i18n/pygettext.py
index 4f0866e..d4ea597 100755
--- a/Tools/i18n/pygettext.py
+++ b/Tools/i18n/pygettext.py
@@ -265,7 +265,7 @@ def containsAny(str, set):
def _visit_pyfiles(list, dirname, names):
"""Helper for getFilesForName()."""
# get extension for python source files
- if not globals().has_key('_py_ext'):
+ if '_py_ext' not in globals():
global _py_ext
_py_ext = [triple[0] for triple in imp.get_suffixes()
if triple[2] == imp.PY_SOURCE][0]