mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Fix use of 'file' as a variable name.
(I've tested the fixes, but please proofread anyway.)
This commit is contained in:
parent
bf1bef820c
commit
ac6df95d07
16 changed files with 108 additions and 107 deletions
|
@ -9,21 +9,21 @@ import sys
|
|||
def main():
|
||||
files = sys.argv[1:]
|
||||
suffixes = {}
|
||||
for file in files:
|
||||
suff = getsuffix(file)
|
||||
for filename in files:
|
||||
suff = getsuffix(filename)
|
||||
if not suffixes.has_key(suff):
|
||||
suffixes[suff] = []
|
||||
suffixes[suff].append(file)
|
||||
suffixes[suff].append(filename)
|
||||
keys = suffixes.keys()
|
||||
keys.sort()
|
||||
for suff in keys:
|
||||
print `suff`, len(suffixes[suff])
|
||||
|
||||
def getsuffix(file):
|
||||
def getsuffix(filename):
|
||||
suff = ''
|
||||
for i in range(len(file)):
|
||||
if file[i] == '.':
|
||||
suff = file[i:]
|
||||
for i in range(len(filename)):
|
||||
if filename[i] == '.':
|
||||
suff = filename[i:]
|
||||
return suff
|
||||
|
||||
main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue