mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
Fix #1296 SyntaxError for breakpoints with empty condition
Treat breakpoints with `condition: ""` as non-conditional.
This commit is contained in:
parent
c9e5ab5b3f
commit
07fda2b10a
2 changed files with 3 additions and 3 deletions
|
|
@ -59,10 +59,10 @@ class LineBreakpoint(object):
|
|||
|
||||
@property
|
||||
def has_condition(self):
|
||||
return self.condition is not None or self.hit_condition is not None
|
||||
return bool(self.condition) or bool(self.hit_condition)
|
||||
|
||||
def handle_hit_condition(self, frame):
|
||||
if self.hit_condition is None:
|
||||
if not self.hit_condition:
|
||||
return False
|
||||
ret = False
|
||||
with self._hit_condition_lock:
|
||||
|
|
|
|||
|
|
@ -500,7 +500,7 @@ class PyDB(object):
|
|||
if pybreakpoint.handle_hit_condition(new_frame):
|
||||
return True
|
||||
|
||||
if condition is None:
|
||||
if not condition:
|
||||
return False
|
||||
|
||||
return eval(condition, new_frame.f_globals, new_frame.f_locals)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue