diff --git a/fetch.py b/fetch.py index 8ae37e314..2c860429f 100755 --- a/fetch.py +++ b/fetch.py @@ -20,7 +20,7 @@ These parameters will be passed through to the config's main method. import json import argparse import os -import pipes +import shlex import subprocess import sys @@ -57,7 +57,7 @@ class Checkout(object): pass def run(self, cmd, return_stdout=False, **kwargs): - print('Running: %s' % (' '.join(pipes.quote(x) for x in cmd))) + print('Running: %s' % (' '.join(shlex.quote(x) for x in cmd))) if self.options.dry_run: return '' if return_stdout: @@ -98,7 +98,7 @@ class GclientCheckout(Checkout): class GitCheckout(Checkout): def run_git(self, *cmd, **kwargs): - print('Running: git %s' % (' '.join(pipes.quote(x) for x in cmd))) + print('Running: git %s' % (' '.join(shlex.quote(x) for x in cmd))) if self.options.dry_run: return '' return git_common.run(*cmd, **kwargs) diff --git a/gclient_utils.py b/gclient_utils.py index 95006cf0b..eb911e7a0 100644 --- a/gclient_utils.py +++ b/gclient_utils.py @@ -13,10 +13,10 @@ import io import logging import operator import os -import pipes import platform import queue import re +import shlex import stat import subprocess import sys @@ -369,7 +369,7 @@ def safe_makedirs(tree): def CommandToStr(args): """Converts an arg list into a shell escaped string.""" - return ' '.join(pipes.quote(arg) for arg in args) + return ' '.join(shlex.quote(arg) for arg in args) class Wrapper(object):