##// END OF EJS Templates
Allow process_handler to accept a list of arguments
Thomas Kluyver -
Show More
@@ -47,9 +47,10 b' def process_handler(cmd, callback, stderr=subprocess.PIPE):'
47 47
48 48 Parameters
49 49 ----------
50 cmd : str
51 A string to be executed with the underlying system shell (by calling
52 :func:`Popen` with ``shell=True``.
50 cmd : str or list
51 A command to be executed by the system, using :class:`subprocess.Popen`.
52 If a string is passed, it will be run in the system shell. If a list is
53 passed, it will be used directly as arguments.
53 54
54 55 callback : callable
55 56 A one-argument function that will be called with the Popen object.
@@ -68,7 +69,7 b' def process_handler(cmd, callback, stderr=subprocess.PIPE):'
68 69 sys.stderr.flush()
69 70 # On win32, close_fds can't be true when using pipes for stdin/out/err
70 71 close_fds = sys.platform != 'win32'
71 p = subprocess.Popen(cmd, shell=True,
72 p = subprocess.Popen(cmd, shell=isinstance(cmd, py3compat.string_types),
72 73 stdin=subprocess.PIPE,
73 74 stdout=subprocess.PIPE,
74 75 stderr=stderr,
@@ -107,7 +108,7 b' def getoutput(cmd):'
107 108
108 109 Parameters
109 110 ----------
110 cmd : str
111 cmd : str or list
111 112 A command to be executed in the system shell.
112 113
113 114 Returns
@@ -131,7 +132,7 b' def getoutputerror(cmd):'
131 132
132 133 Parameters
133 134 ----------
134 cmd : str
135 cmd : str or list
135 136 A command to be executed in the system shell.
136 137
137 138 Returns
@@ -149,7 +150,7 b' def get_output_error_code(cmd):'
149 150
150 151 Parameters
151 152 ----------
152 cmd : str
153 cmd : str or list
153 154 A command to be executed in the system shell.
154 155
155 156 Returns
@@ -112,7 +112,7 b' def system(cmd):'
112 112
113 113 Parameters
114 114 ----------
115 cmd : str
115 cmd : str or list
116 116 A command to be executed in the system shell.
117 117
118 118 Returns
@@ -138,7 +138,7 b' def getoutput(cmd):'
138 138
139 139 Parameters
140 140 ----------
141 cmd : str
141 cmd : str or list
142 142 A command to be executed in the system shell.
143 143
144 144 Returns
General Comments 0
You need to be logged in to leave comments. Login now