Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9aed6cca
Commit
9aed6cca
authored
Nov 26, 2010
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modernize code in effective().
parent
c877a7c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
21 deletions
+15
-21
Lib/bdb.py
Lib/bdb.py
+15
-21
No files found.
Lib/bdb.py
View file @
9aed6cca
...
...
@@ -565,47 +565,41 @@ def effective(file, line, frame):
that indicates if it is ok to delete a temporary bp.
"""
possibles
=
Breakpoint
.
bplist
[
file
,
line
]
for
i
in
range
(
0
,
len
(
possibles
)):
b
=
possibles
[
i
]
if
b
.
enabled
==
0
:
possibles
=
Breakpoint
.
bplist
[
file
,
line
]
for
b
in
possibles
:
if
not
b
.
enabled
:
continue
if
not
checkfuncname
(
b
,
frame
):
continue
# Count every hit when bp is enabled
b
.
hits
=
b
.
hits
+
1
b
.
hits
+=
1
if
not
b
.
cond
:
# If unconditional, and ignoring,
# go on to next, else break
# If unconditional, and ignoring go on to next, else break
if
b
.
ignore
>
0
:
b
.
ignore
=
b
.
ignore
-
1
b
.
ignore
-=
1
continue
else
:
# breakpoint and marker that's ok
# to delete if temporary
return
(
b
,
1
)
# breakpoint and marker that it's ok to delete if temporary
return
(
b
,
True
)
else
:
# Conditional bp.
# Ignore count applies only to those bpt hits where the
# condition evaluates to true.
try
:
val
=
eval
(
b
.
cond
,
frame
.
f_globals
,
frame
.
f_locals
)
val
=
eval
(
b
.
cond
,
frame
.
f_globals
,
frame
.
f_locals
)
if
val
:
if
b
.
ignore
>
0
:
b
.
ignore
=
b
.
ignore
-
1
b
.
ignore
-=
1
# continue
else
:
return
(
b
,
1
)
return
(
b
,
True
)
# else:
# continue
except
:
# if eval fails, most conservative
# thing is to stop on breakpoint
# regardless of ignore count.
# Don't delete temporary,
# as another hint to user.
return
(
b
,
0
)
# if eval fails, most conservative thing is to stop on
# breakpoint regardless of ignore count. Don't delete
# temporary, as another hint to user.
return
(
b
,
False
)
return
(
None
,
None
)
# -------------------- testing --------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment