@@ -19,7 +19,7 @@ Importing this module will append site-specific paths to the module search path
1919and add a few builtins, unless :option: `-S ` was used. In that case, this module
2020can be safely imported with no automatic modifications to the module search path
2121or 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.
2323
2424.. versionchanged :: 3.3
2525 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
109109alphabetically before :file: `foo.pth `; and :file: `spam ` is omitted because it is
110110not mentioned in either path configuration file.
111111
112- .. index :: pair: module; sitecustomize
112+ :mod: `sitecustomize `
113+ --------------------
114+
115+ .. module :: sitecustomize
113116
114117After these path manipulations, an attempt is made to import a module named
115118:mod: `sitecustomize `, which can perform arbitrary site-specific customizations.
116119It is typically created by a system administrator in the site-packages
117120directory. 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' ``,
119123it is silently ignored. If Python is started without output streams available, as
120124with :file: `pythonw.exe ` on Windows (which is used by default to start IDLE),
121125attempted output from :mod: `sitecustomize ` is ignored. Any other exception
122126causes a silent and perhaps mysterious failure of the process.
123127
124- .. index :: pair: module; usercustomize
128+ :mod: `usercustomize `
129+ --------------------
130+
131+ .. module :: usercustomize
125132
126133After this, an attempt is made to import a module named :mod: `usercustomize `,
127134which 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
129136user site-packages directory (see below), which is part of ``sys.path `` unless
130137disabled 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.
133140
134141Note that for some non-Unix systems, ``sys.prefix `` and ``sys.exec_prefix `` are
135142empty, and the path manipulations are skipped; however the import of
136143:mod: `sitecustomize ` and :mod: `usercustomize ` is still attempted.
137144
145+ .. currentmodule :: site
138146
139147.. _rlcompleter-config :
140148
0 commit comments