Skip to content

Commit c3dc94e

Browse files
committed
Import quote() from shlex
The quote() function used to live in pipes module in python2 and, while an import exists in pipes for backwards compatibility, it seems better to import from shlex.
1 parent d4acdb5 commit c3dc94e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

testinfra/backend/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import collections
1414
import locale
1515
import logging
16-
import pipes
16+
import shlex
1717
import subprocess
1818
import urllib.parse
1919

@@ -168,7 +168,7 @@ def get_hosts(cls, host, **kwargs):
168168
@staticmethod
169169
def quote(command, *args):
170170
if args:
171-
return command % tuple(pipes.quote(a) for a in args)
171+
return command % tuple(shlex.quote(a) for a in args)
172172
return command
173173

174174
def get_sudo_command(self, command, sudo_user):

0 commit comments

Comments
 (0)