Skip to content

Commit

Permalink
Let go of old global watch values when restarting
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanderkamp committed Jul 16, 2022
1 parent f54ace8 commit a278c79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions pudb/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ def setup_state(self):
def restart(self):
from linecache import checkcache
checkcache()
self.ui.reset_global_watch_values()
self.ui.set_source_code_provider(NullSourceCodeProvider())
self.setup_state()

Expand Down
7 changes: 7 additions & 0 deletions pudb/var_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ def set_method(self, method):
def set_scope(self, scope):
self.scope = scope

def reset_value(self):
self._value = self.NOT_EVALUATED


class WatchEvalError:
def __str__(self):
Expand Down Expand Up @@ -840,6 +843,10 @@ def change_watch_scope(self, watch_expr, fvi=None):
self.delete_watch(watch_expr, fvi)
self.add_watch(watch_expr, fvi)

def reset_global_watch_values(self):
for watch_expr in self.global_watches:
watch_expr.reset_value()

# }}}

# vim: foldmethod=marker

0 comments on commit a278c79

Please sign in to comment.