import sys
import subprocess

args = ['*'] + sys.argv[3:]
script = [
  "import sys, runpy, __main__",
  "sys.orig_main = __main__",
  "sys.argv=['%s']" % "','".join(args),
  "runpy.run_module('ptvsd', alter_sys=True, run_name='__main__')"
]
command = ['lldb-6.0', '-b', '-O', 'script ' + '; '.join(script)]
subprocess.call(command)

import sys
import subprocess

args = sys.argv[1:]
script = [
  "import sys,runpy,__main__",
  "sys.orig_main = __main__",
  "sys.argv=['%s']" % "','".join(args),
  "runpy.run_path('%s', run_name='__main__')" % sys.argv[1]
]
command = ['lldb-6.0', '-b', '-O', 'script ' + '; '.join(script)]
subprocess.call(command)

Make python debugging work with latest Python extension.
Make python debugging work with latest Python extension.

  import sys
  import subprocess
  
- args = ['*'] + sys.argv[3:]
+ args = sys.argv[1:]
  script = [
-   "import sys, runpy, __main__",
+   "import sys,runpy,__main__",
    "sys.orig_main = __main__",
    "sys.argv=['%s']" % "','".join(args),
-   "runpy.run_module('ptvsd', alter_sys=True, run_name='__main__')"
+   "runpy.run_path('%s', run_name='__main__')" % sys.argv[1]
  ]
  command = ['lldb-6.0', '-b', '-O', 'script ' + '; '.join(script)]
  subprocess.call(command)
  
Make python debugging work with latest Python extension.
## Code Before:
import sys
import subprocess

args = ['*'] + sys.argv[3:]
script = [
  "import sys, runpy, __main__",
  "sys.orig_main = __main__",
  "sys.argv=['%s']" % "','".join(args),
  "runpy.run_module('ptvsd', alter_sys=True, run_name='__main__')"
]
command = ['lldb-6.0', '-b', '-O', 'script ' + '; '.join(script)]
subprocess.call(command)

## Instruction:
Make python debugging work with latest Python extension.
## Code After:
import sys
import subprocess

args = sys.argv[1:]
script = [
  "import sys,runpy,__main__",
  "sys.orig_main = __main__",
  "sys.argv=['%s']" % "','".join(args),
  "runpy.run_path('%s', run_name='__main__')" % sys.argv[1]
]
command = ['lldb-6.0', '-b', '-O', 'script ' + '; '.join(script)]
subprocess.call(command)
