MCPcopy Create free account
hub / github.com/microsoft/debugpy / _make_python_cmdline

Method _make_python_cmdline

tests/debug/session.py:384–401  ·  view source on GitHub ↗
(self, exe, *args)

Source from the content-addressed store, hash-verified

382 return env
383
384 def _make_python_cmdline(self, exe, *args):
385 def normalize(s, strip_quotes=False):
386 # Convert py.path.local to string
387 if isinstance(s, py.path.local):
388 s = s.strpath
389 else:
390 s = str(s)
391 # Strip surrounding quotes if requested
392 if strip_quotes and len(s) >= 2 and " " in s and (s[0] == s[-1] == '"' or s[0] == s[-1] == "'"):
393 s = s[1:-1]
394 return s
395
396 # Strip quotes from exe
397 result = [normalize(exe, strip_quotes=True)]
398 for arg in args:
399 # Don't strip quotes on anything except the exe
400 result.append(normalize(arg, strip_quotes=False))
401 return result
402
403 def spawn_debuggee(self, args, cwd=None, exe=sys.executable, setup=None):
404 assert self.debuggee is None

Callers 2

spawn_debuggeeMethod · 0.95
spawn_adapterMethod · 0.95

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected