MCPcopy
hub / github.com/pex-tool/pex / _safe_args

Function _safe_args

testing/subprocess.py:33–45  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

31
32
33def _safe_args(args):
34 # type: (Sequence[str]) -> List[str]
35 if WINDOWS:
36 argv0 = args[0]
37 pex_info = _maybe_load_pex_info(argv0)
38 if pex_info and is_python_script(argv0, check_executable=False):
39 try:
40 return [Virtualenv(os.path.dirname(argv0)).interpreter.binary] + list(args)
41 except InvalidVirtualenvError:
42 pass
43 if pex_info or argv0.endswith(".py"):
44 return [sys.executable] + list(args)
45 return args if isinstance(args, list) else list(args)
46
47
48def call(

Callers 4

callFunction · 0.85
check_callFunction · 0.85
check_outputFunction · 0.85
__init__Method · 0.85

Calls 2

is_python_scriptFunction · 0.90
_maybe_load_pex_infoFunction · 0.85

Tested by

no test coverage detected