Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d59cde8

Browse files
committed
Some quick fixes of code that was sorting dict.keys() etc.
1 parent 1a0270f commit d59cde8

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

Lib/modulefinder.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,7 @@ def report(self):
487487
print(" %-25s %s" % ("Name", "File"))
488488
print(" %-25s %s" % ("----", "----"))
489489
# Print modules found
490-
keys = self.modules.keys()
491-
keys.sort()
490+
keys = sorted(self.modules.keys())
492491
for key in keys:
493492
m = self.modules[key]
494493
if m.__path__:
@@ -503,17 +502,15 @@ def report(self):
503502
print()
504503
print("Missing modules:")
505504
for name in missing:
506-
mods = self.badmodules[name].keys()
507-
mods.sort()
505+
mods = sorted(self.badmodules[name].keys())
508506
print("?", name, "imported from", ', '.join(mods))
509507
# Print modules that may be missing, but then again, maybe not...
510508
if maybe:
511509
print()
512510
print("Submodules thay appear to be missing, but could also be", end=' ')
513511
print("global names in the parent package:")
514512
for name in maybe:
515-
mods = self.badmodules[name].keys()
516-
mods.sort()
513+
mods = sorted(self.badmodules[name].keys())
517514
print("?", name, "imported from", ', '.join(mods))
518515

519516
def any_missing(self):

0 commit comments

Comments
 (0)