Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b1c1315b
Commit
b1c1315b
authored
May 05, 1995
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new release by Ken, fix handling of from
parent
2db6bfcd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
Lib/newimp.py
Lib/newimp.py
+12
-6
No files found.
Lib/newimp.py
View file @
b1c1315b
...
...
@@ -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
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
# Developers Notes:
...
...
@@ -250,10 +250,16 @@ def import_module(name,
return
(
container
or
theMod
)
else
:
# Implement 'from': Populate immediate env with module defs:
if
froms
==
'*'
:
froms
=
theMod
.
__dict__
.
keys
()
# resolve '*'
for
item
in
froms
:
while
froms
:
item
=
froms
[
0
];
del
froms
[
0
]
if
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
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