diff mbox series

fetch2/git: Use quote from shlex, not pipes

Message ID 20240930131848.2419329-1-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit 9ef4f2a30127455562e38e869793a723eed6c07c
Headers show
Series fetch2/git: Use quote from shlex, not pipes | expand

Commit Message

Richard Purdie Sept. 30, 2024, 1:18 p.m. UTC
The pipes module is removed in python 3.13. It was already using the
quote function from shlex so use that directly instead.

The module already imports shlex too so it is an easy substitution.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/fetch2/git.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 6a1f47a32e..5b678827ed 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -952,9 +952,8 @@  class Git(FetchMethod):
             commits = None
         else:
             if not os.path.exists(rev_file) or not os.path.getsize(rev_file):
-                from pipes import quote
                 commits = bb.fetch2.runfetchcmd(
-                        "git rev-list %s -- | wc -l" % quote(rev),
+                        "git rev-list %s -- | wc -l" % shlex.quote(rev),
                         d, quiet=True).strip().lstrip('0')
                 if commits:
                     open(rev_file, "w").write("%d\n" % int(commits))