Ned Batchelder  committed 783923f

Find .pyw files when searching for source files.

  • Participants
  • Parent commits 83d8945

Comments (0)

Files changed (2)

File coverage/

         for filename in filenames:
             # We're only interested in files that look like reasonable Python
-            # files: Must end with .py, and must not have certain funny
+            # files: Must end with .py or .pyw, and must not have certain funny
             # characters that probably mean they are editor junk.
-            if re.match(r"^[^.#~!$@%^&*()+=,]+\.py$", filename):
+            if re.match(r"^[^.#~!$@%^&*()+=,]+\.pyw?$", filename):
                 yield os.path.join(dirpath, filename)

File tests/

         self.make_file("sub/ssub/")            # nope: editor effluvia
         self.make_file("sub/lab/")            # nope: no
+        self.make_file("sub/windows.pyw")
         py_files = set(find_python_files("sub"))
         self.assert_same_files(py_files, [
             "sub/", "sub/",
             "sub/ssub/", "sub/ssub/",
+            "sub/windows.pyw",