1. python_mirrors
  2. 2to3


Benjamin Peterson  committed 126d1ee

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

  • Participants
  • Parent commits 8afecad
  • Branches default

Comments (0)

Files changed (2)

File lib2to3/refactor.py

View file
             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

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