Convert import side-effects into explicit calls.

This commit is contained in:
Eric Snow 2018-01-09 20:14:29 +00:00
parent 4095e94e6d
commit 3858988621
3 changed files with 16 additions and 9 deletions

View file

@ -2,12 +2,15 @@
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
import pydevd
import ptvsd.wrapper
__author__ = "Microsoft Corporation <ptvshelp@microsoft.com>"
__version__ = "4.0.0a1"
if __name__ == '__main__':
# XXX Convert side-effects into explicit calls.
import ptvsd.wrapper
import pydevd
ptvsd.wrapper.install()
pydevd.main()

View file

@ -4,6 +4,10 @@
import sys
import pydevd
import ptvsd.wrapper
__author__ = "Microsoft Corporation <ptvshelp@microsoft.com>"
__version__ = "4.0.0a1"
@ -13,9 +17,7 @@ DONT_DEBUG = []
def debug(filename, port_num, debug_id, debug_options, run_as):
# XXX docstring
# XXX Convert side-effects into explicit calls.
import ptvsd.wrapper
import pydevd
ptvsd.wrapper.install()
sys.argv[1:0] = [
'--port', str(port_num),
'--client', '127.0.0.1',

View file

@ -666,6 +666,8 @@ def start_client(host, port):
return pydevd
# These are the functions pydevd invokes to get a socket to the client.
pydevd_comm.start_server = start_server
pydevd_comm.start_client = start_client
def install():
"""Configure pydevd to use our wrapper."""
# These are the functions pydevd invokes to get a socket to the client.
pydevd_comm.start_server = start_server
pydevd_comm.start_client = start_client