diff options
author | Georg Brandl <georg@python.org> | 2008-05-16 15:23:30 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-05-16 15:23:30 (GMT) |
commit | 8efadf5d6613e76dfc5476f58adb9a2135173129 (patch) | |
tree | 93ea7c3914c65801cd3844aa0ea1304676076940 /Tools/scripts/pdeps.py | |
parent | d11ae5d6ecda1d233af651a360c9f9140992f05d (diff) | |
download | cpython-8efadf5d6613e76dfc5476f58adb9a2135173129.zip cpython-8efadf5d6613e76dfc5476f58adb9a2135173129.tar.gz cpython-8efadf5d6613e76dfc5476f58adb9a2135173129.tar.bz2 |
Ran 2to3 over scripts directory.
Diffstat (limited to 'Tools/scripts/pdeps.py')
-rwxr-xr-x | Tools/scripts/pdeps.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Tools/scripts/pdeps.py b/Tools/scripts/pdeps.py index 35b4067..5c5a05b 100755 --- a/Tools/scripts/pdeps.py +++ b/Tools/scripts/pdeps.py @@ -92,7 +92,7 @@ def process(filename, table): # Compute closure (this is in fact totally general) # def closure(table): - modules = table.keys() + modules = list(table.keys()) # # Initialize reach with a copy of table # @@ -135,7 +135,7 @@ def inverse(table): # If there is no list for the key yet, it is created. # def store(dict, key, item): - if dict.has_key(key): + if key in dict: dict[key].append(item) else: dict[key] = [item] @@ -144,13 +144,11 @@ def store(dict, key, item): # Tabulate results neatly # def printresults(table): - modules = table.keys() + modules = sorted(table.keys()) maxlen = 0 for mod in modules: maxlen = max(maxlen, len(mod)) - modules.sort() for mod in modules: - list = table[mod] - list.sort() + list = sorted(table[mod]) print(mod.ljust(maxlen), ':', end=' ') if mod in list: print('(*)', end=' ') |