diff options
| author | Lumír 'Frenzy' Balhar <lbalhar@redhat.com> | 2022-06-07 12:07:19 +0200 |
|---|---|---|
| committer | Bernát Gábor <bgabor8@bloomberg.net> | 2022-06-10 13:57:19 +0100 |
| commit | 0bf46eb638753a80afa6b1e1e1938f7efd1cdc0c (patch) | |
| tree | 45ae1f38afd54f69eda615d2eb7bf662a407d847 /src | |
| parent | 784163eb4720f1db8f0946c547642af4b9856333 (diff) | |
| download | virtualenv-0bf46eb638753a80afa6b1e1e1938f7efd1cdc0c.tar.gz | |
Use shlex.quote instead of deprecated pipes.quote (#2351)
Diffstat (limited to 'src')
| -rw-r--r-- | src/virtualenv/discovery/cached_py_info.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/virtualenv/discovery/cached_py_info.py b/src/virtualenv/discovery/cached_py_info.py index 31beff5..4e1d976 100644 --- a/src/virtualenv/discovery/cached_py_info.py +++ b/src/virtualenv/discovery/cached_py_info.py @@ -8,7 +8,6 @@ from __future__ import absolute_import, unicode_literals import logging import os -import pipes import sys from collections import OrderedDict @@ -19,6 +18,11 @@ from virtualenv.util.path import Path from virtualenv.util.six import ensure_text from virtualenv.util.subprocess import Popen, subprocess +if PY2: + from pipes import quote +else: + from shlex import quote + _CACHE = OrderedDict() _CACHE[Path(sys.executable)] = PythonInfo() @@ -126,7 +130,7 @@ class LogCmd(object): def e(v): return v.decode("utf-8") if isinstance(v, bytes) else v - cmd_repr = e(" ").join(pipes.quote(e(c)) for c in self.cmd) + cmd_repr = e(" ").join(quote(e(c)) for c in self.cmd) if self.env is not None: cmd_repr += e(" env of {!r}").format(self.env) if PY2: |
