mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
More 2to3 fixes in the Tools directory. Fixes #2893.
This commit is contained in:
parent
acbca71ea7
commit
bf82e374ee
38 changed files with 1999 additions and 2032 deletions
|
@ -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' % \
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue