changeset 52012:cd788962c6d9 stable

tests: use shlex.quote instead of pipes.quote The pipes module got removed in python 3.13. https://bugs.debian.org/1084553
author Julien Cristau <jcristau@debian.org>
date Mon, 14 Oct 2024 16:46:25 +0200
parents 37f693975cbc
children 5713adc51f2a
files tests/test-verify-repo-operations.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-verify-repo-operations.py	Tue Oct 15 04:33:30 2024 +0200
+++ b/tests/test-verify-repo-operations.py	Mon Oct 14 16:46:25 2024 +0200
@@ -36,7 +36,7 @@
 
 import binascii
 from contextlib import contextmanager
-import pipes
+import shlex
 import shutil
 import silenttestrunner
 import subprocess
@@ -267,7 +267,7 @@
         if os.path.exists(path):
             return
         self.log.append(
-            "$ mkdir -p -- %s" % (pipes.quote(os.path.relpath(path)),)
+            "$ mkdir -p -- %s" % (shlex.quote(os.path.relpath(path)),)
         )
         os.makedirs(path)
 
@@ -276,7 +276,7 @@
         if path == ".":
             return
         os.chdir(path)
-        self.log.append("$ cd -- %s" % (pipes.quote(path),))
+        self.log.append("$ cd -- %s" % (shlex.quote(path),))
 
     def hg(self, *args):
         extra_flags = []
@@ -286,7 +286,7 @@
         self.command("hg", *(tuple(extra_flags) + args))
 
     def command(self, *args):
-        self.log.append("$ " + ' '.join(map(pipes.quote, args)))
+        self.log.append("$ " + ' '.join(map(shlex.quote, args)))
         subprocess.check_output(args, stderr=subprocess.STDOUT)
 
     # Section: Set up basic data
@@ -355,7 +355,7 @@
             )
             % (
                 binascii.hexlify(content),
-                pipes.quote(path),
+                shlex.quote(path),
             )
         )
 
@@ -405,7 +405,7 @@
         if amend:
             errors.append("cannot amend public changesets")
             command.append("--amend")
-        command.append("-m" + pipes.quote(message))
+        command.append("-m" + shlex.quote(message))
         if secret:
             command.append("--secret")
         if close_branch: