diff --git a/pudb/debugger.py b/pudb/debugger.py index ff111925..0f0cfe98 100644 --- a/pudb/debugger.py +++ b/pudb/debugger.py @@ -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() diff --git a/pudb/var_view.py b/pudb/var_view.py index 344f9e79..01532d71 100644 --- a/pudb/var_view.py +++ b/pudb/var_view.py @@ -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): @@ -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