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
3fef2eef
Kaydet (Commit)
3fef2eef
authored
Tem 08, 2016
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #26972: Fix some mistakes in importlib-related docstrings.
Thanks to Oren Milman for the patch.
üst
fdcdd9ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
_bootstrap.py
Lib/importlib/_bootstrap.py
+3
-3
_bootstrap_external.py
Lib/importlib/_bootstrap_external.py
+9
-9
No files found.
Lib/importlib/_bootstrap.py
Dosyayı görüntüle @
3fef2eef
...
@@ -270,7 +270,7 @@ def _load_module_shim(self, fullname):
...
@@ -270,7 +270,7 @@ def _load_module_shim(self, fullname):
# Module specifications #######################################################
# Module specifications #######################################################
def
_module_repr
(
module
):
def
_module_repr
(
module
):
# The implementation of ModuleType__repr__().
# The implementation of ModuleType
.
__repr__().
loader
=
getattr
(
module
,
'__loader__'
,
None
)
loader
=
getattr
(
module
,
'__loader__'
,
None
)
if
hasattr
(
loader
,
'module_repr'
):
if
hasattr
(
loader
,
'module_repr'
):
# As soon as BuiltinImporter, FrozenImporter, and NamespaceLoader
# As soon as BuiltinImporter, FrozenImporter, and NamespaceLoader
...
@@ -603,7 +603,7 @@ def _module_repr_from_spec(spec):
...
@@ -603,7 +603,7 @@ def _module_repr_from_spec(spec):
# Used by importlib.reload() and _load_module_shim().
# Used by importlib.reload() and _load_module_shim().
def
_exec
(
spec
,
module
):
def
_exec
(
spec
,
module
):
"""Execute the spec in an existing module's namespace."""
"""Execute the spec
's specified module
in an existing module's namespace."""
name
=
spec
.
name
name
=
spec
.
name
_imp
.
acquire_lock
()
_imp
.
acquire_lock
()
with
_ModuleLockManager
(
name
):
with
_ModuleLockManager
(
name
):
...
@@ -877,7 +877,7 @@ def _find_spec_legacy(finder, name, path):
...
@@ -877,7 +877,7 @@ def _find_spec_legacy(finder, name, path):
def
_find_spec
(
name
,
path
,
target
=
None
):
def
_find_spec
(
name
,
path
,
target
=
None
):
"""Find a module's
loader
."""
"""Find a module's
spec
."""
meta_path
=
sys
.
meta_path
meta_path
=
sys
.
meta_path
if
meta_path
is
None
:
if
meta_path
is
None
:
# PyImport_Cleanup() is running or has been called.
# PyImport_Cleanup() is running or has been called.
...
...
Lib/importlib/_bootstrap_external.py
Dosyayı görüntüle @
3fef2eef
...
@@ -1048,11 +1048,7 @@ class PathFinder:
...
@@ -1048,11 +1048,7 @@ class PathFinder:
@classmethod
@classmethod
def
_path_hooks
(
cls
,
path
):
def
_path_hooks
(
cls
,
path
):
"""Search sequence of hooks for a finder for 'path'.
"""Search sys.path_hooks for a finder for 'path'."""
If 'hooks' is false then use sys.path_hooks.
"""
if
sys
.
path_hooks
is
not
None
and
not
sys
.
path_hooks
:
if
sys
.
path_hooks
is
not
None
and
not
sys
.
path_hooks
:
_warnings
.
warn
(
'sys.path_hooks is empty'
,
ImportWarning
)
_warnings
.
warn
(
'sys.path_hooks is empty'
,
ImportWarning
)
for
hook
in
sys
.
path_hooks
:
for
hook
in
sys
.
path_hooks
:
...
@@ -1134,8 +1130,10 @@ class PathFinder:
...
@@ -1134,8 +1130,10 @@ class PathFinder:
@classmethod
@classmethod
def
find_spec
(
cls
,
fullname
,
path
=
None
,
target
=
None
):
def
find_spec
(
cls
,
fullname
,
path
=
None
,
target
=
None
):
"""find the module on sys.path or 'path' based on sys.path_hooks and
"""Try to find a spec for 'fullname' on sys.path or 'path'.
sys.path_importer_cache."""
The search is based on sys.path_hooks and sys.path_importer_cache.
"""
if
path
is
None
:
if
path
is
None
:
path
=
sys
.
path
path
=
sys
.
path
spec
=
cls
.
_get_spec
(
fullname
,
path
,
target
)
spec
=
cls
.
_get_spec
(
fullname
,
path
,
target
)
...
@@ -1215,8 +1213,10 @@ class FileFinder:
...
@@ -1215,8 +1213,10 @@ class FileFinder:
submodule_search_locations
=
smsl
)
submodule_search_locations
=
smsl
)
def
find_spec
(
self
,
fullname
,
target
=
None
):
def
find_spec
(
self
,
fullname
,
target
=
None
):
"""Try to find a spec for the specified module. Returns the
"""Try to find a spec for the specified module.
matching spec, or None if not found."""
Returns the matching spec, or None if not found.
"""
is_namespace
=
False
is_namespace
=
False
tail_module
=
fullname
.
rpartition
(
'.'
)[
2
]
tail_module
=
fullname
.
rpartition
(
'.'
)[
2
]
try
:
try
:
...
...
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