From ea7081b0c30e224b59887f46aef27a9db5c42002 Mon Sep 17 00:00:00 2001 From: STerliakov Date: Mon, 23 Oct 2023 20:39:28 +0400 Subject: [PATCH] Replace deprecated `pipes` module with `shlex.quote` --- executor/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/executor/__init__.py b/executor/__init__.py index dbe2eb7..cf3d304 100644 --- a/executor/__init__.py +++ b/executor/__init__.py @@ -44,7 +44,6 @@ import errno import logging import os -import pipes import pprint import shlex import signal @@ -1986,7 +1985,7 @@ def quote(*args): """ Quote a string or a sequence of strings to be used as command line argument(s). - This function is a simple wrapper around :func:`pipes.quote()` which + This function is a simple wrapper around :func:`shlex.quote()` which adds support for quoting sequences of strings (lists and tuples). For example the following calls are all equivalent:: @@ -2006,7 +2005,7 @@ def quote(*args): else: value = args[0] if not isinstance(value, (list, tuple)): - return pipes.quote(value) + return shlex.quote(value) return ' '.join(map(quote, value))