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
eb51faad
Kaydet (Commit)
eb51faad
authored
Haz 30, 2016
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #27418: Fixed Tools/importbench/importbench.py.
üst
45750982
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
NEWS
Misc/NEWS
+5
-0
importbench.py
Tools/importbench/importbench.py
+6
-7
No files found.
Misc/NEWS
Dosyayı görüntüle @
eb51faad
...
...
@@ -72,6 +72,11 @@ C API
-
Issue
#
26754
:
PyUnicode_FSDecoder
()
accepted
a
filename
argument
encoded
as
an
iterable
of
integers
.
Now
only
strings
and
bytes
-
like
objects
are
accepted
.
Tools
/
Demos
-----------
-
Issue
#
27418
:
Fixed
Tools
/
importbench
/
importbench
.
py
.
What
's New in Python 3.5.2?
===========================
...
...
Tools/importbench/importbench.py
Dosyayı görüntüle @
eb51faad
...
...
@@ -5,7 +5,6 @@ thus has no external changes made to import-related attributes in sys.
"""
from
test.test_importlib
import
util
from
test.test_importlib.source
import
util
as
source_util
import
decimal
import
imp
import
importlib
...
...
@@ -65,11 +64,11 @@ def source_wo_bytecode(seconds, repeat):
try
:
name
=
'__importlib_test_benchmark__'
# Clears out sys.modules and puts an entry at the front of sys.path.
with
source_
util
.
create_modules
(
name
)
as
mapping
:
with
util
.
create_modules
(
name
)
as
mapping
:
assert
not
os
.
path
.
exists
(
imp
.
cache_from_source
(
mapping
[
name
]))
sys
.
meta_path
.
append
(
importlib
.
machinery
.
PathFinder
)
loader
=
(
importlib
.
machinery
.
SourceFileLoader
,
importlib
.
machinery
.
SOURCE_SUFFIXES
,
True
)
importlib
.
machinery
.
SOURCE_SUFFIXES
)
sys
.
path_hooks
.
append
(
importlib
.
machinery
.
FileFinder
.
path_hook
(
loader
))
yield
from
bench
(
name
,
lambda
:
sys
.
modules
.
pop
(
name
),
repeat
=
repeat
,
seconds
=
seconds
)
...
...
@@ -102,10 +101,10 @@ def source_writing_bytecode(seconds, repeat):
"""Source writing bytecode: small"""
assert
not
sys
.
dont_write_bytecode
name
=
'__importlib_test_benchmark__'
with
source_
util
.
create_modules
(
name
)
as
mapping
:
with
util
.
create_modules
(
name
)
as
mapping
:
sys
.
meta_path
.
append
(
importlib
.
machinery
.
PathFinder
)
loader
=
(
importlib
.
machinery
.
SourceFileLoader
,
importlib
.
machinery
.
SOURCE_SUFFIXES
,
True
)
importlib
.
machinery
.
SOURCE_SUFFIXES
)
sys
.
path_hooks
.
append
(
importlib
.
machinery
.
FileFinder
.
path_hook
(
loader
))
def
cleanup
():
sys
.
modules
.
pop
(
name
)
...
...
@@ -136,10 +135,10 @@ decimal_writing_bytecode = _writing_bytecode(decimal)
def
source_using_bytecode
(
seconds
,
repeat
):
"""Source w/ bytecode: small"""
name
=
'__importlib_test_benchmark__'
with
source_
util
.
create_modules
(
name
)
as
mapping
:
with
util
.
create_modules
(
name
)
as
mapping
:
sys
.
meta_path
.
append
(
importlib
.
machinery
.
PathFinder
)
loader
=
(
importlib
.
machinery
.
SourceFileLoader
,
importlib
.
machinery
.
SOURCE_SUFFIXES
,
True
)
importlib
.
machinery
.
SOURCE_SUFFIXES
)
sys
.
path_hooks
.
append
(
importlib
.
machinery
.
FileFinder
.
path_hook
(
loader
))
py_compile
.
compile
(
mapping
[
name
])
assert
os
.
path
.
exists
(
imp
.
cache_from_source
(
mapping
[
name
]))
...
...
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