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
d94e558f
Kaydet (Commit)
d94e558f
authored
Şub 07, 2009
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Move importlib's built-in importer to use rpartition for __package__.
üst
eb2e0dd1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
_bootstrap.py
Lib/importlib/_bootstrap.py
+3
-1
test_loader.py
Lib/importlib/test/builtin/test_loader.py
+1
-1
No files found.
Lib/importlib/_bootstrap.py
Dosyayı görüntüle @
d94e558f
...
@@ -115,7 +115,9 @@ class BuiltinImporter:
...
@@ -115,7 +115,9 @@ class BuiltinImporter:
"""Load a built-in module."""
"""Load a built-in module."""
if
fullname
not
in
sys
.
builtin_module_names
:
if
fullname
not
in
sys
.
builtin_module_names
:
raise
ImportError
(
"{0} is not a built-in module"
.
format
(
fullname
))
raise
ImportError
(
"{0} is not a built-in module"
.
format
(
fullname
))
return
imp
.
init_builtin
(
fullname
)
module
=
imp
.
init_builtin
(
fullname
)
module
.
__package__
=
''
return
module
class
FrozenImporter
:
class
FrozenImporter
:
...
...
Lib/importlib/test/builtin/test_loader.py
Dosyayı görüntüle @
d94e558f
...
@@ -15,7 +15,7 @@ class LoaderTests(abc.LoaderTests):
...
@@ -15,7 +15,7 @@ class LoaderTests(abc.LoaderTests):
assert
'errno'
in
sys
.
builtin_module_names
assert
'errno'
in
sys
.
builtin_module_names
name
=
'errno'
name
=
'errno'
verification
=
{
'__name__'
:
'errno'
,
'__package__'
:
None
}
verification
=
{
'__name__'
:
'errno'
,
'__package__'
:
''
}
def
verify
(
self
,
module
):
def
verify
(
self
,
module
):
"""Verify that the module matches against what it should have."""
"""Verify that the module matches against what it should have."""
...
...
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