Merge pull request #30 from ericsnowcurrently/lint

Fix lint failures.
This commit is contained in:
Eric Snow 2018-02-01 12:46:53 -07:00 committed by GitHub
commit fdbcbeea45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 14 deletions

View file

@ -155,7 +155,6 @@ class Union(tuple):
return True
return NotImplemented
def __ne__(self, other):
return not (self == other)

View file

@ -3,13 +3,13 @@
# for license information.
__author__ = "Microsoft Corporation <ptvshelp@microsoft.com>"
__version__ = "4.0.0a1"
if __name__ == '__main__':
# import the wrapper first, so that it gets a chance to detour pydevd socket functionality.
import ptvsd.wrapper
# import the wrapper first, so that it gets a chance
# to detour pydevd socket functionality.
import ptvsd.wrapper # noqa
import pydevd
pydevd.main()

View file

@ -12,11 +12,13 @@ DONT_DEBUG = []
def debug(filename, port_num, debug_id, debug_options, run_as):
# import the wrapper first, so that it gets a chance to detour pydevd socket functionality.
# TODO: docstring
# import the wrapper first, so that it gets a chance
# to detour pydevd socket functionality.
import ptvsd.wrapper
import pydevd
# TODO: docstring
sys.argv[1:0] = [
'--port', str(port_num),
'--client', '127.0.0.1',

View file

@ -36,6 +36,7 @@ __version__ = "4.0.0a1"
ptvsd_sys_exit_code = 0
def unquote(s):
if s is None:
return None
@ -475,13 +476,17 @@ class VSCodeMessageProcessor(ipcjson.SocketIO, ipcjson.IpcChannel):
vsc_var = int(args['variablesReference'])
pyd_var = self.var_map.to_pydevd(vsc_var)
# VSC gives us variablesReference to the parent of the variable being set, and
# variable name; but pydevd wants the ID (or rather path) of the variable itself.
# VSC gives us variablesReference to the parent of the variable
# being set, and variable name; but pydevd wants the ID
# (or rather path) of the variable itself.
pyd_var += (args['name'],)
vsc_var = self.var_map.to_vscode(pyd_var)
cmd_args = [str(s) for s in pyd_var] + [args['value']]
_, _, resp_args = yield self.pydevd_request(pydevd_comm.CMD_CHANGE_VARIABLE, '\t'.join(cmd_args))
_, _, resp_args = yield self.pydevd_request(
pydevd_comm.CMD_CHANGE_VARIABLE,
'\t'.join(cmd_args),
)
xml = untangle.parse(resp_args).xml
xvar = xml.var
@ -553,7 +558,8 @@ class VSCodeMessageProcessor(ipcjson.SocketIO, ipcjson.IpcChannel):
line = src_bp['line']
vsc_bpid = self.bp_map.add(
lambda vsc_bpid: (path, vsc_bpid))
msg = msgfmt.format(vsc_bpid, path, line, src_bp.get('condition', None))
msg = msgfmt.format(vsc_bpid, path, line,
src_bp.get('condition', None))
self.pydevd_notify(cmd, msg)
bps.append({
'id': vsc_bpid,
@ -574,7 +580,7 @@ class VSCodeMessageProcessor(ipcjson.SocketIO, ipcjson.IpcChannel):
if break_raised or break_uncaught:
# notify_always options:
# 1 is deprecated, you will see a warning message
# 2 notify on first raise only
# 2 notify on first raise only
# 3 or greater, notify always
notify_always = 3 if break_raised else 0
@ -587,8 +593,8 @@ class VSCodeMessageProcessor(ipcjson.SocketIO, ipcjson.IpcChannel):
# Less than or equal to 0 DO NOT ignore libraries
# Greater than 0 ignore libraries
ignore_libraries = 1
cmdargs = (notify_always,
notify_on_terminate,
cmdargs = (notify_always,
notify_on_terminate,
ignore_libraries)
msg = 'python-BaseException\t{}\t{}\t{}'.format(*cmdargs)
self.pydevd_notify(pydevd_comm.CMD_ADD_EXCEPTION_BREAK, msg)