MCPcopy Create free account
hub / github.com/numpy/numpy / _quote_arg

Function _quote_arg

numpy/distutils/exec_command.py:305–313  ·  view source on GitHub ↗

Quote the argument for safe use in a shell command line.

(arg)

Source from the content-addressed store, hash-verified

303
304
305def _quote_arg(arg):
306 """
307 Quote the argument for safe use in a shell command line.
308 """
309 # If there is a quote in the string, assume relevants parts of the
310 # string are already quoted (e.g. '-I"C:\\Program Files\\..."')
311 if '"' not in arg and ' ' in arg:
312 return '"%s"' % arg
313 return arg
314
315############################################################

Callers 1

_exec_commandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected