]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-122044: Don't error during gitignore filtering with no files (GH-122045...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 27 Jul 2024 14:27:34 +0000 (16:27 +0200)
committerGitHub <noreply@github.com>
Sat, 27 Jul 2024 14:27:34 +0000 (14:27 +0000)
Co-authored-by: Seth Michael Larson <seth@python.org>
Tools/build/generate_sbom.py

index c08568f2e00326166a65c8ea114aafb31bbe3efd..1b000c3b16a17a772357466c26643e2c56dd4eab 100644 (file)
@@ -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(