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
fd4ff52c
Commit
fd4ff52c
authored
Jul 12, 2001
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Actually remove directories from sys.path if they do not exist; the intent
is to avoid as many stat() calls as we can.
parent
9b23920b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
Lib/site.py
Lib/site.py
+4
-0
No files found.
Lib/site.py
View file @
fd4ff52c
...
@@ -79,6 +79,10 @@ del m
...
@@ -79,6 +79,10 @@ del m
L
=
[]
L
=
[]
dirs_in_sys_path
=
{}
dirs_in_sys_path
=
{}
for
dir
in
sys
.
path
:
for
dir
in
sys
.
path
:
# Filter out paths that don't exist, but leave in the empty string
# since it's a special case.
if
dir
and
not
os
.
path
.
isdir
(
dir
):
continue
dir
,
dircase
=
makepath
(
dir
)
dir
,
dircase
=
makepath
(
dir
)
if
not
dirs_in_sys_path
.
has_key
(
dircase
):
if
not
dirs_in_sys_path
.
has_key
(
dircase
):
L
.
append
(
dir
)
L
.
append
(
dir
)
...
...
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