@@ -97,20 +97,22 @@ not mentioned in either path configuration file.
97
97
After these path manipulations, an attempt is made to import a module named
98
98
:mod: `sitecustomize `, which can perform arbitrary site-specific customizations.
99
99
It is typically created by a system administrator in the site-packages
100
- directory. If this import fails with an :exc: `ImportError ` exception, it is
101
- silently ignored. If Python is started without output streams available, as
100
+ directory. If this import fails with an :exc: `ImportError ` or its subclass
101
+ exception, and the exception's :attr: `name ` attribute equals to ``'sitecustomize' ``,
102
+ it is silently ignored. If Python is started without output streams available, as
102
103
with :file: `pythonw.exe ` on Windows (which is used by default to start IDLE),
103
- attempted output from :mod: `sitecustomize ` is ignored. Any exception other
104
- than :exc: `ImportError ` causes a silent and perhaps mysterious failure of the
105
- process.
104
+ attempted output from :mod: `sitecustomize ` is ignored. Any other exception
105
+ causes a silent and perhaps mysterious failure of the process.
106
106
107
107
.. index :: module: usercustomize
108
108
109
109
After this, an attempt is made to import a module named :mod: `usercustomize `,
110
110
which can perform arbitrary user-specific customizations, if
111
111
:data: `ENABLE_USER_SITE ` is true. This file is intended to be created in the
112
112
user site-packages directory (see below), which is part of ``sys.path `` unless
113
- disabled by :option: `-s `. An :exc: `ImportError ` will be silently ignored.
113
+ disabled by :option: `-s `. If this import fails with an :exc: `ImportError ` or
114
+ its subclass exception, and the exception's :attr: `name ` attribute equals to
115
+ ``'usercustomize' ``, it is silently ignored.
114
116
115
117
Note that for some non-Unix systems, ``sys.prefix `` and ``sys.exec_prefix `` are
116
118
empty, and the path manipulations are skipped; however the import of
0 commit comments