Skip to content

Commit

Permalink
Add validation to not publish pdb_state after publishing values of va…
Browse files Browse the repository at this point in the history
…riables.
  • Loading branch information
dalthviz committed Oct 21, 2017
1 parent 05d12d4 commit b932918
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spyder/utils/ipython/spyder_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def __init__(self, *args, **kwargs):
self.namespace_view_settings = {}
self._pdb_obj = None
self._pdb_step = None
self._publish_data = False

kernel_config = self.config.get('IPKernelApp', None)
if kernel_config is not None:
Expand Down Expand Up @@ -157,6 +158,7 @@ def get_value(self, name):
# petitions to display a value
value = None
publish_data({'__spy_data__': value})
self._publish_data = True

def set_value(self, name, value):
"""Set the value of a variable"""
Expand Down Expand Up @@ -212,11 +214,12 @@ def publish_pdb_state(self):
Publish Variable Explorer state and Pdb step through
publish_data.
"""
if self._pdb_obj:
if self._pdb_obj and not self._publish_data:
state = dict(namespace_view = self.get_namespace_view(),
var_properties = self.get_var_properties(),
step = self._pdb_step)
publish_data({'__spy_pdb_state__': state})
self._publish_data = False

def pdb_continue(self):
"""
Expand Down

0 comments on commit b932918

Please sign in to comment.