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
b1c1315b
Kaydet (Commit)
b1c1315b
authored
May 05, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
new release by Ken, fix handling of from
üst
2db6bfcd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
newimp.py
Lib/newimp.py
+12
-6
No files found.
Lib/newimp.py
Dosyayı görüntüle @
b1c1315b
...
@@ -68,9 +68,9 @@ also denoted in the module by '__package__'. Additionally, modules have
...
@@ -68,9 +68,9 @@ also denoted in the module by '__package__'. Additionally, modules have
associated with them a '__pkgpath__', a path by which sibling modules are
associated with them a '__pkgpath__', a path by which sibling modules are
found."""
found."""
__version__
=
"
$Revision$
"
__version__
=
"
Revision: 1.13
"
#
$Id$
First release:
#
Id: newimp.py,v 1.13 1995/04/13 23:23:33 klm Exp
First release:
# Ken.Manheimer@nist.gov, 5-Apr-1995, for python 1.2
# Ken.Manheimer@nist.gov, 5-Apr-1995, for python 1.2
# Developers Notes:
# Developers Notes:
...
@@ -250,10 +250,16 @@ def import_module(name,
...
@@ -250,10 +250,16 @@ def import_module(name,
return
(
container
or
theMod
)
return
(
container
or
theMod
)
else
:
else
:
# Implement 'from': Populate immediate env with module defs:
# Implement 'from': Populate immediate env with module defs:
if
froms
==
'*'
:
while
froms
:
froms
=
theMod
.
__dict__
.
keys
()
# resolve '*'
item
=
froms
[
0
];
del
froms
[
0
]
for
item
in
froms
:
if
item
==
'*'
:
(
envLocals
or
envGlobals
)[
item
]
=
theMod
.
__dict__
[
item
]
froms
=
theMod
.
__dict__
.
keys
()
+
froms
else
:
try
:
(
envLocals
or
envGlobals
)[
item
]
=
theMod
.
__dict__
[
item
]
except
KeyError
:
raise
ImportError
,
(
"name '
%
s' not found in module
%
s"
%
(
item
,
theMod
.
__name__
))
return
theMod
return
theMod
def
unload
(
module
):
def
unload
(
module
):
...
...
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