replace pipes.quote with shlex.quote, they do the same thing

This commit is contained in:
sthen
2025-11-05 19:12:18 +00:00
parent b2dc9c3662
commit 325a5d5af5
3 changed files with 43 additions and 1 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ MODPY_DISTV= 10.0
DISTNAME= humanfriendly-${MODPY_DISTV}
PKGNAME= py-${DISTNAME}
CATEGORIES= textproc
REVISION= 2
REVISION= 3
HOMEPAGE= https://humanfriendly.readthedocs.io/
@@ -0,0 +1,21 @@
Index: humanfriendly/cli.py
--- humanfriendly/cli.py.orig
+++ humanfriendly/cli.py
@@ -79,7 +79,7 @@ Supported options:
# Standard library modules.
import functools
import getopt
-import pipes
+import shlex
import subprocess
import sys
@@ -176,7 +176,7 @@ def main():
def run_command(command_line):
"""Run an external command and show a spinner while the command is running."""
timer = Timer()
- spinner_label = "Waiting for command: %s" % " ".join(map(pipes.quote, command_line))
+ spinner_label = "Waiting for command: %s" % " ".join(map(shlex.quote, command_line))
with Spinner(label=spinner_label, timer=timer) as spinner:
process = subprocess.Popen(command_line)
while True:
@@ -0,0 +1,21 @@
Index: humanfriendly/testing.py
--- humanfriendly/testing.py.orig
+++ humanfriendly/testing.py
@@ -25,7 +25,7 @@ its much better error reporting) but I've yet to publi
import functools
import logging
import os
-import pipes
+import shlex
import shutil
import sys
import tempfile
@@ -521,7 +521,7 @@ class MockedProgram(CustomSearchPath):
pathname = os.path.join(directory, self.program_name)
with open(pathname, 'w') as handle:
handle.write('#!/bin/sh\n')
- handle.write('echo > %s\n' % pipes.quote(self.program_signal_file))
+ handle.write('echo > %s\n' % shlex.quote(self.program_signal_file))
if self.program_script:
handle.write('%s\n' % self.program_script.strip())
handle.write('exit %i\n' % self.program_returncode)