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
27b029bd
Kaydet (Commit)
27b029bd
authored
Ock 09, 2014
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
clear zip stat cache after each ref leak run
üst
7251fe10
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
regrtest.py
Lib/test/regrtest.py
+7
-4
test_pkgutil.py
Lib/test/test_pkgutil.py
+1
-3
No files found.
Lib/test/regrtest.py
Dosyayı görüntüle @
27b029bd
...
@@ -1002,9 +1002,10 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
...
@@ -1002,9 +1002,10 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
try
:
try
:
import
zipimport
import
zipimport
except
ImportError
:
except
ImportError
:
zdc
=
None
# Run unmodified on platforms without zipimport support
z
sc
=
z
dc
=
None
# Run unmodified on platforms without zipimport support
else
:
else
:
zdc
=
zipimport
.
_zip_directory_cache
.
copy
()
zdc
=
zipimport
.
_zip_directory_cache
.
copy
()
zsc
=
zipimport
.
_zip_stat_cache
.
copy
()
abcs
=
{}
abcs
=
{}
modules
=
_abcoll
,
_pyio
modules
=
_abcoll
,
_pyio
for
abc
in
[
getattr
(
mod
,
a
)
for
mod
in
modules
for
a
in
mod
.
__all__
]:
for
abc
in
[
getattr
(
mod
,
a
)
for
mod
in
modules
for
a
in
mod
.
__all__
]:
...
@@ -1027,12 +1028,12 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
...
@@ -1027,12 +1028,12 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
repcount
=
nwarmup
+
ntracked
repcount
=
nwarmup
+
ntracked
print
>>
sys
.
stderr
,
"beginning"
,
repcount
,
"repetitions"
print
>>
sys
.
stderr
,
"beginning"
,
repcount
,
"repetitions"
print
>>
sys
.
stderr
,
(
"1234567890"
*
(
repcount
//
10
+
1
))[:
repcount
]
print
>>
sys
.
stderr
,
(
"1234567890"
*
(
repcount
//
10
+
1
))[:
repcount
]
dash_R_cleanup
(
fs
,
ps
,
pic
,
zdc
,
abcs
)
dash_R_cleanup
(
fs
,
ps
,
pic
,
zdc
,
zsc
,
abcs
)
for
i
in
range
(
repcount
):
for
i
in
range
(
repcount
):
rc_before
=
sys
.
gettotalrefcount
()
rc_before
=
sys
.
gettotalrefcount
()
run_the_test
()
run_the_test
()
sys
.
stderr
.
write
(
'.'
)
sys
.
stderr
.
write
(
'.'
)
dash_R_cleanup
(
fs
,
ps
,
pic
,
zdc
,
abcs
)
dash_R_cleanup
(
fs
,
ps
,
pic
,
zdc
,
zsc
,
abcs
)
rc_after
=
sys
.
gettotalrefcount
()
rc_after
=
sys
.
gettotalrefcount
()
if
i
>=
nwarmup
:
if
i
>=
nwarmup
:
deltas
.
append
(
rc_after
-
rc_before
)
deltas
.
append
(
rc_after
-
rc_before
)
...
@@ -1046,7 +1047,7 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
...
@@ -1046,7 +1047,7 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
return
True
return
True
return
False
return
False
def
dash_R_cleanup
(
fs
,
ps
,
pic
,
zdc
,
abcs
):
def
dash_R_cleanup
(
fs
,
ps
,
pic
,
zdc
,
zsc
,
abcs
):
import
gc
,
copy_reg
import
gc
,
copy_reg
import
_strptime
,
linecache
import
_strptime
,
linecache
dircache
=
test_support
.
import_module
(
'dircache'
,
deprecated
=
True
)
dircache
=
test_support
.
import_module
(
'dircache'
,
deprecated
=
True
)
...
@@ -1072,6 +1073,8 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs):
...
@@ -1072,6 +1073,8 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs):
else
:
else
:
zipimport
.
_zip_directory_cache
.
clear
()
zipimport
.
_zip_directory_cache
.
clear
()
zipimport
.
_zip_directory_cache
.
update
(
zdc
)
zipimport
.
_zip_directory_cache
.
update
(
zdc
)
zipimport
.
_zip_stat_cache
.
clear
()
zipimport
.
_zip_stat_cache
.
update
(
zsc
)
# clear type cache
# clear type cache
sys
.
_clear_type_cache
()
sys
.
_clear_type_cache
()
...
...
Lib/test/test_pkgutil.py
Dosyayı görüntüle @
27b029bd
...
@@ -133,9 +133,7 @@ class PkgutilPEP302Tests(unittest.TestCase):
...
@@ -133,9 +133,7 @@ class PkgutilPEP302Tests(unittest.TestCase):
def
test_main
():
def
test_main
():
run_unittest
(
PkgutilTests
,
PkgutilPEP302Tests
)
run_unittest
(
PkgutilTests
,
PkgutilPEP302Tests
)
# this is necessary if test is run repeated (like when finding leaks)
import
zipimport
zipimport
.
_zip_directory_cache
.
clear
()
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
test_main
()
test_main
()
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