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
9a8439d3
Kaydet (Commit)
9a8439d3
authored
Eki 22, 2010
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refactor interesting use of try-finally.
üst
eb7e5692
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
pstats.py
Lib/pstats.py
+9
-10
No files found.
Lib/pstats.py
Dosyayı görüntüle @
9a8439d3
...
...
@@ -93,15 +93,12 @@ class Stats:
self
.
stats
=
{}
self
.
sort_arg_dict
=
{}
self
.
load_stats
(
arg
)
trouble
=
1
try
:
self
.
get_top_level_stats
()
trouble
=
0
finally
:
if
trouble
:
print
(
"Invalid timing data"
,
end
=
' '
,
file
=
self
.
stream
)
if
self
.
files
:
print
(
self
.
files
[
-
1
],
end
=
' '
,
file
=
self
.
stream
)
print
(
file
=
self
.
stream
)
except
Exception
:
print
(
"Invalid timing data
%
s"
%
(
self
.
files
[
-
1
]
if
self
.
files
else
''
),
file
=
self
.
stream
)
raise
def
load_stats
(
self
,
arg
):
if
arg
is
None
:
...
...
@@ -271,7 +268,8 @@ class Stats:
return
self
def
calc_callees
(
self
):
if
self
.
all_callees
:
return
if
self
.
all_callees
:
return
self
.
all_callees
=
all_callees
=
{}
for
func
,
(
cc
,
nc
,
tt
,
ct
,
callers
)
in
self
.
stats
.
items
():
if
not
func
in
all_callees
:
...
...
@@ -341,7 +339,8 @@ class Stats:
def
print_stats
(
self
,
*
amount
):
for
filename
in
self
.
files
:
print
(
filename
,
file
=
self
.
stream
)
if
self
.
files
:
print
(
file
=
self
.
stream
)
if
self
.
files
:
print
(
file
=
self
.
stream
)
indent
=
' '
*
8
for
func
in
self
.
top_level
:
print
(
indent
,
func_get_function_name
(
func
),
file
=
self
.
stream
)
...
...
@@ -427,7 +426,7 @@ class Stats:
print
(
' ncalls tottime percall cumtime percall'
,
end
=
' '
,
file
=
self
.
stream
)
print
(
'filename:lineno(function)'
,
file
=
self
.
stream
)
def
print_line
(
self
,
func
):
# hack
: should print percentages
def
print_line
(
self
,
func
):
# hack: should print percentages
cc
,
nc
,
tt
,
ct
,
callers
=
self
.
stats
[
func
]
c
=
str
(
nc
)
if
nc
!=
cc
:
...
...
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