From 5c70a2e14aea675beb3b06fdd57ebac16399e3f6 Mon Sep 17 00:00:00 2001 From: Evgeny Vereshchagin Date: Tue, 21 Feb 2023 21:11:42 +0300 Subject: [PATCH] [helper] replace pipes.quote with shlex.quote (#9757) pipes got deprecated in https://github.com/python/cpython/commit/2551a6c92f247eed8121b14f151acd95432dff9e and Python3.11 complains about it: ``` infra/helper.py:27: DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13 import pipes ``` The pipes module just uses shlex.quote so it can be used direcly instead. --- infra/helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infra/helper.py b/infra/helper.py index c9ada6907..604134f47 100755 --- a/infra/helper.py +++ b/infra/helper.py @@ -24,8 +24,8 @@ import datetime import errno import logging import os -import pipes import re +import shlex import shutil import subprocess import sys @@ -542,7 +542,7 @@ def _get_absolute_path(path): def _get_command_string(command): """Returns a shell escaped command string.""" - return ' '.join(pipes.quote(part) for part in command) + return ' '.join(shlex.quote(part) for part in command) def _get_project_build_subdir(project, subdir_name):