https://github.com/python/cpython/commit/4e04d1a3d237abd0cba354024556c39519e0d163
commit: 4e04d1a3d237abd0cba354024556c39519e0d163
branch: main
author: Seth Michael Larson <[email protected]>
committer: hugovk <[email protected]>
date: 2024-07-27T14:10:05+03:00
summary:

gh-122044: Don't error during gitignore filtering with no files (#122045)

files:
M Tools/build/generate_sbom.py

diff --git a/Tools/build/generate_sbom.py b/Tools/build/generate_sbom.py
index c08568f2e00326..1b000c3b16a17a 100644
--- a/Tools/build/generate_sbom.py
+++ b/Tools/build/generate_sbom.py
@@ -108,6 +108,10 @@ def filter_gitignored_paths(paths: list[str]) -> list[str]:
 
         '.gitignore:9:*.a    Tools/lib.a'
     """
+    # No paths means no filtering to be done.
+    if not paths:
+        return []
+
     # Filter out files in gitignore.
     # Non-matching files show up as '::<whitespace><path>'
     git_check_ignore_proc = subprocess.run(

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to