|
23 | 23 | import argparse
|
24 | 24 | import subprocess
|
25 | 25 | import tarfile
|
26 |
| -import pipes |
| 26 | +if sys.version_info < (3, 3): |
| 27 | + from pipes import quote as _quote |
| 28 | +else: |
| 29 | + from shlex import quote as _quote |
27 | 30 | import platform
|
28 | 31 | import zipfile
|
29 | 32 | import shutil
|
@@ -733,7 +736,7 @@ def build_node_from_src(env_dir, src_dir, node_src_dir, args):
|
733 | 736 |
|
734 | 737 | conf_cmd = [
|
735 | 738 | './configure',
|
736 |
| - '--prefix=%s' % pipes.quote(env_dir) |
| 739 | + '--prefix=%s' % _quote(env_dir) |
737 | 740 | ]
|
738 | 741 | if args.without_ssl:
|
739 | 742 | conf_cmd.append('--without-ssl')
|
@@ -815,7 +818,7 @@ def install_npm(env_dir, _src_dir, args):
|
815 | 818 | (
|
816 | 819 | 'bash', '-c',
|
817 | 820 | '. {0} && npm install -g npm@{1}'.format(
|
818 |
| - pipes.quote(join(env_dir, 'bin', 'activate')), |
| 821 | + _quote(join(env_dir, 'bin', 'activate')), |
819 | 822 | args.npm,
|
820 | 823 | )
|
821 | 824 | ),
|
@@ -883,10 +886,10 @@ def install_packages(env_dir, args):
|
883 | 886 | activate_path = join(env_dir, 'bin', 'activate')
|
884 | 887 | real_npm_ver = args.npm if args.npm.count(".") == 2 else args.npm + ".0"
|
885 | 888 | if args.npm == "latest" or real_npm_ver >= "1.0.0":
|
886 |
| - cmd = '. ' + pipes.quote(activate_path) + \ |
| 889 | + cmd = '. ' + _quote(activate_path) + \ |
887 | 890 | ' && npm install -g %(pack)s'
|
888 | 891 | else:
|
889 |
| - cmd = '. ' + pipes.quote(activate_path) + \ |
| 892 | + cmd = '. ' + _quote(activate_path) + \ |
890 | 893 | ' && npm install %(pack)s' + \
|
891 | 894 | ' && npm activate %(pack)s'
|
892 | 895 |
|
|
0 commit comments