Skip to content

Commit 9cb8f95

Browse files
committed
Remove unsued escape_unix_path util function.
1 parent 4a4be76 commit 9cb8f95

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

pyinfra/api/connectors/util.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
from __future__ import unicode_literals
22

3-
import re
4-
53
from getpass import getpass
64
from socket import timeout as timeout_error
75
from subprocess import PIPE, Popen
86

9-
try:
10-
from pathlib import PurePath
11-
except ImportError:
12-
PurePath = None
13-
147
import click
158
import gevent
169
import six
@@ -22,8 +15,6 @@
2215
from pyinfra.api import Config, MaskString, QuoteString, StringCommand
2316
from pyinfra.api.util import memoize
2417

25-
UNIX_PATH_SPACE_REGEX = re.compile(r'([^\\]) ')
26-
2718
SUDO_ASKPASS_ENV_VAR = 'PYINFRA_SUDO_PASSWORD'
2819
SUDO_ASKPASS_EXE_FILENAME = 'pyinfra-sudo-askpass'
2920

@@ -34,17 +25,6 @@ def get_sudo_askpass_exe():
3425
'''.format(SUDO_ASKPASS_ENV_VAR))
3526

3627

37-
def escape_unix_path(path):
38-
'''
39-
Escape unescaped spaces in a (unix) path.
40-
'''
41-
42-
if PurePath and isinstance(path, PurePath):
43-
path = str(path)
44-
45-
return UNIX_PATH_SPACE_REGEX.sub(r'\1\\ ', path)
46-
47-
4828
def read_buffer(type_, io, output_queue, print_output=False, print_func=None):
4929
'''
5030
Reads a file-like buffer object into lines and optionally prints the output.

0 commit comments

Comments
 (0)