|
1 | | -diff --git a/executor/__init__.py b/executor/__init__.py |
2 | | -index dbe2eb7..3633f82 100644 |
3 | | ---- a/executor/__init__.py |
4 | | -+++ b/executor/__init__.py |
5 | | -@@ -44,7 +44,6 @@ |
6 | | - import errno |
7 | | - import logging |
8 | | - import os |
9 | | --import pipes |
10 | | - import pprint |
11 | | - import shlex |
12 | | - import signal |
13 | | -@@ -52,6 +51,13 @@ |
14 | | - import sys |
15 | | - import tempfile |
16 | | - |
17 | | -+# The pipes module was deprecated in 3.11 (to be removed in 3.13). |
18 | | -+# shlex.quote was introduced in 3.3 and pipes adopted it immediately. |
19 | | -+if sys.version_info < (3, 3): |
20 | | -+ from pipes import quote as py_quote |
21 | | -+else: |
22 | | -+ from shlex import quote as py_quote |
23 | | -+ |
24 | | - # External dependencies. |
25 | | - from humanfriendly.text import compact, concatenate, format, pluralize |
26 | | - from humanfriendly.terminal import connected_to_terminal |
27 | | -@@ -1986,7 +1992,8 @@ def quote(*args): |
28 | | - """ |
29 | | - Quote a string or a sequence of strings to be used as command line argument(s). |
30 | | - |
31 | | -- This function is a simple wrapper around :func:`pipes.quote()` which |
32 | | -+ This function is a simple wrapper around :func:`shlex.quote()` |
33 | | -+ or :func:`pipes.quote()` (if the Python version is less than 3.3) which |
34 | | - adds support for quoting sequences of strings (lists and tuples). For |
35 | | - example the following calls are all equivalent:: |
36 | | - |
37 | | -@@ -2006,7 +2013,7 @@ def quote(*args): |
38 | | - else: |
39 | | - value = args[0] |
40 | | - if not isinstance(value, (list, tuple)): |
41 | | -- return pipes.quote(value) |
42 | | -+ return py_quote(value) |
43 | | - return ' '.join(map(quote, value)) |
| 1 | +diff --git a/executor/__init__.py b/executor/__init__.py |
| 2 | +index dbe2eb7..3633f82 100644 |
| 3 | +--- a/executor/__init__.py |
| 4 | ++++ b/executor/__init__.py |
| 5 | +@@ -44,7 +44,6 @@ |
| 6 | + import errno |
| 7 | + import logging |
| 8 | + import os |
| 9 | +-import pipes |
| 10 | + import pprint |
| 11 | + import shlex |
| 12 | + import signal |
| 13 | +@@ -52,6 +51,13 @@ |
| 14 | + import sys |
| 15 | + import tempfile |
| 16 | + |
| 17 | ++# The pipes module was deprecated in 3.11 (to be removed in 3.13). |
| 18 | ++# shlex.quote was introduced in 3.3 and pipes adopted it immediately. |
| 19 | ++if sys.version_info < (3, 3): |
| 20 | ++ from pipes import quote as py_quote |
| 21 | ++else: |
| 22 | ++ from shlex import quote as py_quote |
| 23 | ++ |
| 24 | + # External dependencies. |
| 25 | + from humanfriendly.text import compact, concatenate, format, pluralize |
| 26 | + from humanfriendly.terminal import connected_to_terminal |
| 27 | +@@ -1986,7 +1992,8 @@ def quote(*args): |
| 28 | + """ |
| 29 | + Quote a string or a sequence of strings to be used as command line argument(s). |
| 30 | + |
| 31 | +- This function is a simple wrapper around :func:`pipes.quote()` which |
| 32 | ++ This function is a simple wrapper around :func:`shlex.quote()` |
| 33 | ++ or :func:`pipes.quote()` (if the Python version is less than 3.3) which |
| 34 | + adds support for quoting sequences of strings (lists and tuples). For |
| 35 | + example the following calls are all equivalent:: |
| 36 | + |
| 37 | +@@ -2006,7 +2013,7 @@ def quote(*args): |
| 38 | + else: |
| 39 | + value = args[0] |
| 40 | + if not isinstance(value, (list, tuple)): |
| 41 | +- return pipes.quote(value) |
| 42 | ++ return py_quote(value) |
| 43 | + return ' '.join(map(quote, value)) |
0 commit comments