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
62b297b6
Commit
62b297b6
authored
Sep 08, 1997
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change packages -> site-packages
parent
d6ead328
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
Lib/site.py
Lib/site.py
+10
-8
No files found.
Lib/site.py
View file @
62b297b6
...
...
@@ -12,8 +12,9 @@ works).
This will append site-specific paths to to the module search path. It
starts with sys.prefix and sys.exec_prefix (if different) and appends
lib/python<version>/packages. The resulting directory, if it exists,
is added to sys.path, and also inspected for path configuration files.
lib/python<version>/site-packages as well as lib/site-python. The
resulting directories, if they exist, are appended to sys.path, and
also inspected for path configuration files.
A path configuration file is a file whose name has the form
<package>.pth; its contents are additional directories (one per line)
...
...
@@ -23,9 +24,10 @@ sys.path more than once. Blank lines and lines beginning with
\
code{#}
a
re skipped.
For example, suppose sys.prefix and sys.exec_prefix are set to
/usr/local and there is a directory /usr/local/python1.5/packages with
three subdirectories, foo, bar and spam, and two path configuration
files, foo.pth and bar.pth. Assume foo.pth contains the following:
/usr/local and there is a directory /usr/local/python1.5/site-packages
with three subdirectories, foo, bar and spam, and two path
configuration files, foo.pth and bar.pth. Assume foo.pth contains the
following:
# foo package configuration
foo
...
...
@@ -39,8 +41,8 @@ and bar.pth contains:
Then the following directories are added to sys.path, in this order:
/usr/local/lib/python1.5/packages/bar
/usr/local/lib/python1.5/packages/foo
/usr/local/lib/python1.5/
site-
packages/bar
/usr/local/lib/python1.5/
site-
packages/foo
Note that bletch is omitted because it doesn't exist; bar precedes foo
because bar.pth comes alphabetically before foo.pth; and spam is
...
...
@@ -99,7 +101,7 @@ for prefix in prefixes:
sitedirs
=
[
os
.
path
.
join
(
prefix
,
"lib"
,
"python"
+
sys
.
version
[:
3
],
"packages"
),
"
site-
packages"
),
os
.
path
.
join
(
prefix
,
"lib"
,
"site-python"
)]
else
:
sitedirs
=
[
prefix
]
...
...
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