[Python-checkins] r53047 - sandbox/trunk/2to3/refactor.py

guido.van.rossum python-checkins at python.org
Sun Dec 17 05:46:33 CET 2006


Author: guido.van.rossum
Date: Sun Dec 17 05:46:33 2006
New Revision: 53047

Modified:
   sandbox/trunk/2to3/refactor.py
Log:
Sort directory listings, for more reproducible results.


Modified: sandbox/trunk/2to3/refactor.py
==============================================================================
--- sandbox/trunk/2to3/refactor.py	(original)
+++ sandbox/trunk/2to3/refactor.py	Sun Dec 17 05:46:33 2006
@@ -72,7 +72,9 @@
 def get_all_fix_names():
     """Return a sorted list of all available fix names."""
     fix_names = []
-    for name in os.listdir(os.path.dirname(fixes.__file__)):
+    names = os.listdir(os.path.dirname(fixes.__file__))
+    names.sort()
+    for name in names:
         if name.startswith("fix_") and name.endswith(".py"):
             fix_names.append(name[4:-3])
     fix_names.sort()
@@ -153,6 +155,8 @@
         for dirpath, dirnames, filenames in os.walk(arg):
             if self.options.verbose:
                 self.log_message("Descending into %s", dirpath)
+            dirnames.sort()
+            filenames.sort()
             for name in filenames:
                 if not name.startswith(".") and name.endswith("py"):
                     fullname = os.path.join(dirpath, name)


More information about the Python-checkins mailing list