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
7ec28d29
Commit
7ec28d29
authored
Nov 20, 1999
by
Greg Stein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
turn SysPathImporter into PathImporter.
parent
72ee4352
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
Lib/imputil.py
Lib/imputil.py
+7
-6
No files found.
Lib/imputil.py
View file @
7ec28d29
...
...
@@ -21,7 +21,7 @@
import
imp
import
sys
import
strop
import
__builtin__
### why this instead of just using __builtins__ ??
import
__builtin__
# for the DirectoryImporter
import
struct
...
...
@@ -588,10 +588,11 @@ class DirectoryImporter(Importer):
######################################################################
#
# Emulate the standard
sys.path
import mechanism
# Emulate the standard
path-style
import mechanism
#
class
SysPathImporter
(
Importer
):
def
__init__
(
self
):
class
PathImporter
(
Importer
):
def
__init__
(
self
,
path
=
sys
.
path
):
self
.
path
=
path
# we're definitely going to be importing something in the future,
# so let's just load the OS-related facilities.
...
...
@@ -604,7 +605,7 @@ class SysPathImporter(Importer):
return
_fs_import
(
parent
.
__pkgdir__
,
modname
)
# scan sys.path, looking for the requested module
for
dir
in
s
ys
.
path
:
for
dir
in
s
elf
.
path
:
result
=
_fs_import
(
dir
,
modname
)
if
result
:
return
result
...
...
@@ -649,7 +650,7 @@ def _test_dir():
def
_test_revamp
():
"Debug/test function for the revamped import system."
BuiltinImporter
().
install
()
Sys
PathImporter
().
install
()
PathImporter
().
install
()
def
_print_importers
():
items
=
sys
.
modules
.
items
()
...
...
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