Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #30 from ericsnowcurrently/lint
Browse files Browse the repository at this point in the history
Fix lint failures.
  • Loading branch information
ericsnowcurrently authored Feb 1, 2018
2 parents d0cf2f8 + 99ee358 commit fdbcbee
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
1 change: 0 additions & 1 deletion debugger_protocol/arg/_decl.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ def __eq__(self, other): # honors order
return True
return NotImplemented


def __ne__(self, other):
return not (self == other)

Expand Down
6 changes: 3 additions & 3 deletions ptvsd/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# for license information.



__author__ = "Microsoft Corporation <[email protected]>"
__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()
6 changes: 4 additions & 2 deletions ptvsd/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@


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',
Expand Down
22 changes: 14 additions & 8 deletions ptvsd/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

ptvsd_sys_exit_code = 0


def unquote(s):
if s is None:
return None
Expand Down Expand Up @@ -475,13 +476,17 @@ def on_setVariable(self, request, args):
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

Expand Down Expand Up @@ -553,7 +558,8 @@ def on_setBreakpoints(self, request, args):
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,
Expand All @@ -574,7 +580,7 @@ def on_setExceptionBreakpoints(self, request, args):
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

Expand All @@ -587,8 +593,8 @@ def on_setExceptionBreakpoints(self, request, args):
# 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)
Expand Down

0 comments on commit fdbcbee

Please sign in to comment.