--- a/eric6/DebugClients/Python/BreakpointWatch.py Wed Apr 14 19:38:19 2021 +0200 +++ b/eric6/DebugClients/Python/BreakpointWatch.py Wed Apr 14 19:59:16 2021 +0200 @@ -8,6 +8,7 @@ """ import os +import contextlib class Breakpoint: @@ -226,10 +227,8 @@ """ Public method to clear this watch expression. """ - try: + with contextlib.suppress(ValueError): del Watch.watches[self] - except ValueError: - pass def enable(self): """ @@ -251,10 +250,8 @@ @param cond expression of the watch expression to be cleared @type str """ - try: + with contextlib.suppress(ValueError): Watch.watches.remove(Watch.get_watch(cond)) - except ValueError: - pass @staticmethod def clear_all_watches():