Commits

Benjamin Peterson  committed 126d1ee

don't parse files just because they end with 'py' (no dot)

  • Participants
  • Parent commits 8afecad

Comments (0)

Files changed (2)

File lib2to3/refactor.py

             dirnames.sort()
             filenames.sort()
             for name in filenames:
-                if not name.startswith(".") and name.endswith("py"):
+                if not name.startswith(".") and \
+                        os.path.splitext(name)[1].endswith("py"):
                     fullname = os.path.join(dirpath, name)
                     self.refactor_file(fullname, write, doctests_only)
             # Modify dirnames in-place to remove subdirs with leading dots

File lib2to3/tests/test_refactor.py

         tree = ["nothing",
                 "hi.py",
                 ".dumb",
-                ".after.py"]
+                ".after.py",
+                "sappy"]
         expected = ["hi.py"]
         check(tree, expected)
         tree = ["hi.py",