Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
9aed6cca
Kaydet (Commit)
9aed6cca
authored
Kas 26, 2010
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Modernize code in effective().
üst
c877a7c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
21 deletions
+15
-21
bdb.py
Lib/bdb.py
+15
-21
No files found.
Lib/bdb.py
Dosyayı görüntüle @
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