@@ -19,7 +19,7 @@ Importing this module will append site-specific paths to the module search path
19
19
and add a few builtins, unless :option: `-S ` was used. In that case, this module
20
20
can be safely imported with no automatic modifications to the module search path
21
21
or additions to the builtins. To explicitly trigger the usual site-specific
22
- additions, call the :func: `site. main ` function.
22
+ additions, call the :func: `main ` function.
23
23
24
24
.. versionchanged :: 3.3
25
25
Importing the module used to trigger paths manipulation even when using
@@ -109,32 +109,40 @@ directory precedes the :file:`foo` directory because :file:`bar.pth` comes
109
109
alphabetically before :file: `foo.pth `; and :file: `spam ` is omitted because it is
110
110
not mentioned in either path configuration file.
111
111
112
- .. index :: pair: module; sitecustomize
112
+ :mod: `sitecustomize `
113
+ --------------------
114
+
115
+ .. module :: sitecustomize
113
116
114
117
After these path manipulations, an attempt is made to import a module named
115
118
:mod: `sitecustomize `, which can perform arbitrary site-specific customizations.
116
119
It is typically created by a system administrator in the site-packages
117
120
directory. If this import fails with an :exc: `ImportError ` or its subclass
118
- exception, and the exception's :attr: `name ` attribute equals to ``'sitecustomize' ``,
121
+ exception, and the exception's :attr: `~ImportError.name `
122
+ attribute equals to ``'sitecustomize' ``,
119
123
it is silently ignored. If Python is started without output streams available, as
120
124
with :file: `pythonw.exe ` on Windows (which is used by default to start IDLE),
121
125
attempted output from :mod: `sitecustomize ` is ignored. Any other exception
122
126
causes a silent and perhaps mysterious failure of the process.
123
127
124
- .. index :: pair: module; usercustomize
128
+ :mod: `usercustomize `
129
+ --------------------
130
+
131
+ .. module :: usercustomize
125
132
126
133
After this, an attempt is made to import a module named :mod: `usercustomize `,
127
134
which can perform arbitrary user-specific customizations, if
128
- :data: `ENABLE_USER_SITE ` is true. This file is intended to be created in the
135
+ :data: `~site. ENABLE_USER_SITE ` is true. This file is intended to be created in the
129
136
user site-packages directory (see below), which is part of ``sys.path `` unless
130
137
disabled by :option: `-s `. If this import fails with an :exc: `ImportError ` or
131
- its subclass exception, and the exception's :attr: `name ` attribute equals to
132
- ``'usercustomize' ``, it is silently ignored.
138
+ its subclass exception, and the exception's :attr: `~ImportError. name `
139
+ attribute equals to ``'usercustomize' ``, it is silently ignored.
133
140
134
141
Note that for some non-Unix systems, ``sys.prefix `` and ``sys.exec_prefix `` are
135
142
empty, and the path manipulations are skipped; however the import of
136
143
:mod: `sitecustomize ` and :mod: `usercustomize ` is still attempted.
137
144
145
+ .. currentmodule :: site
138
146
139
147
.. _rlcompleter-config :
140
148
0 commit comments