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
66e7363c
Kaydet (Commit)
66e7363c
authored
Ock 21, 2008
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#1269: fix a bug in pstats.add_callers() and add a unit test file for pstats.
üst
2778c999
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
1 deletion
+31
-1
pstats.py
Lib/pstats.py
+2
-1
test_pstats.py
Lib/test/test_pstats.py
+26
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/pstats.py
Dosyayı görüntüle @
66e7363c
...
@@ -512,7 +512,8 @@ def add_callers(target, source):
...
@@ -512,7 +512,8 @@ def add_callers(target, source):
new_callers
[
func
]
=
caller
new_callers
[
func
]
=
caller
for
func
,
caller
in
source
.
iteritems
():
for
func
,
caller
in
source
.
iteritems
():
if
func
in
new_callers
:
if
func
in
new_callers
:
new_callers
[
func
]
=
caller
+
new_callers
[
func
]
new_callers
[
func
]
=
tuple
([
i
[
0
]
+
i
[
1
]
for
i
in
zip
(
caller
,
new_callers
[
func
])])
else
:
else
:
new_callers
[
func
]
=
caller
new_callers
[
func
]
=
caller
return
new_callers
return
new_callers
...
...
Lib/test/test_pstats.py
0 → 100644
Dosyayı görüntüle @
66e7363c
import
unittest
from
test
import
test_support
import
pstats
class
AddCallersTestCase
(
unittest
.
TestCase
):
"""Tests for pstats.add_callers helper."""
def
test_combine_results
(
self
):
"""pstats.add_callers should combine the call results of both target
and source by adding the call time. See issue1269."""
target
=
{
"a"
:
(
1
,
2
,
3
,
4
)}
source
=
{
"a"
:
(
1
,
2
,
3
,
4
),
"b"
:
(
5
,
6
,
7
,
8
)}
new_callers
=
pstats
.
add_callers
(
target
,
source
)
self
.
assertEqual
(
new_callers
,
{
'a'
:
(
2
,
4
,
6
,
8
),
'b'
:
(
5
,
6
,
7
,
8
)})
def
test_main
():
test_support
.
run_unittest
(
AddCallersTestCase
)
if
__name__
==
"__main__"
:
test_main
()
Misc/NEWS
Dosyayı görüntüle @
66e7363c
...
@@ -369,6 +369,9 @@ Core and builtins
...
@@ -369,6 +369,9 @@ Core and builtins
Library
Library
-------
-------
- #1269: fix a bug in pstats.add_callers() and add a unit test file for
pstats.
- #1669: don'
t
allow
shutil
.
rmtree
()
to
be
called
on
a
symlink
to
a
- #1669: don'
t
allow
shutil
.
rmtree
()
to
be
called
on
a
symlink
to
a
directory
.
directory
.
...
...
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