mirror of
https://github.com/python/cpython.git
synced 2025-12-04 16:43:27 +00:00
Update the doc string to emphasize non-Unix behavior earlier;
sys.prefix is no longer empty on any platform that I know of.
This commit is contained in:
parent
bc5062f664
commit
0d8fcb233e
1 changed files with 5 additions and 7 deletions
12
Lib/site.py
12
Lib/site.py
|
|
@ -10,9 +10,11 @@ somewhere near the top of their code. Because of the automatic
|
||||||
import, this is no longer necessary (but code that does it still
|
import, this is no longer necessary (but code that does it still
|
||||||
works).
|
works).
|
||||||
|
|
||||||
This will append site-specific paths to to the module search path. It
|
This will append site-specific paths to to the module search path. On
|
||||||
starts with sys.prefix and sys.exec_prefix (if different) and appends
|
Unix, it starts with sys.prefix and sys.exec_prefix (if different) and
|
||||||
lib/python<version>/site-packages as well as lib/site-python. The
|
appends lib/python<version>/site-packages as well as lib/site-python.
|
||||||
|
On other platforms (mainly Mac and Windows), it uses just sys.prefix
|
||||||
|
(and sys.exec_prefix, if different, but this is unlikely). The
|
||||||
resulting directories, if they exist, are appended to sys.path, and
|
resulting directories, if they exist, are appended to sys.path, and
|
||||||
also inspected for path configuration files.
|
also inspected for path configuration files.
|
||||||
|
|
||||||
|
|
@ -53,10 +55,6 @@ named sitecustomize, which can perform arbitrary additional
|
||||||
site-specific customizations. If this import fails with an
|
site-specific customizations. If this import fails with an
|
||||||
ImportError exception, it is silently ignored.
|
ImportError exception, it is silently ignored.
|
||||||
|
|
||||||
Note that for some non-Unix systems, sys.prefix and sys.exec_prefix
|
|
||||||
are empty, and then the path manipulations are skipped; however the
|
|
||||||
import of sitecustomize is still attempted.
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import sys, os
|
import sys, os
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue