Mercurial > cpython-lru_cache-weakref
annotate Lib/distutils/errors.py @ 25838:8540887bcec6 2.2
Backport of 2.183:
Fix memory leak in add_subclass() found by NealN with valgrind.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 18 Oct 2002 13:42:21 +0000 |
| parents | dfdb911cbec2 |
| children | ffec67409140 |
| rev | line source |
|---|---|
|
10435
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
1 """distutils.errors |
|
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
2 |
|
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
3 Provides exceptions used by the Distutils modules. Note that Distutils |
|
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
4 modules may raise standard exceptions; in particular, SystemExit is |
|
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
5 usually raised for errors that are obviously the end-user's fault |
|
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
6 (eg. bad command-line arguments). |
|
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
7 |
|
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
8 This module safe to use in "from ... import *" mode; it only exports |
|
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
9 symbols whose names start with "Distutils" and end with "Error".""" |
|
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
10 |
|
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
11 # created 1999/03/03, Greg Ward |
|
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
12 |
|
11897
017e592c0fd2
Changed '__rcsid__' to '__revision__'.
Greg Ward <gward@python.net>
parents:
11193
diff
changeset
|
13 __revision__ = "$Id$" |
|
10435
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
14 |
|
12791
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
15 class DistutilsError (Exception): |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
16 """The root of all Distutils evil.""" |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
17 pass |
|
10435
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
18 |
|
12791
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
19 class DistutilsModuleError (DistutilsError): |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
20 """Unable to load an expected module, or to find an expected class |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
21 within some module (in particular, command modules and classes).""" |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
22 pass |
|
10435
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
23 |
|
12791
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
24 class DistutilsClassError (DistutilsError): |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
25 """Some command class (or possibly distribution class, if anyone |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
26 feels a need to subclass Distribution) is found not to be holding |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
27 up its end of the bargain, ie. implementing some part of the |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
28 "command "interface.""" |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
29 pass |
|
10435
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
30 |
|
12791
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
31 class DistutilsGetoptError (DistutilsError): |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
32 """The option table provided to 'fancy_getopt()' is bogus.""" |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
33 pass |
|
10435
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
34 |
|
12791
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
35 class DistutilsArgError (DistutilsError): |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
36 """Raised by fancy_getopt in response to getopt.error -- ie. an |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
37 error in the command line usage.""" |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
38 pass |
|
10435
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
39 |
|
12791
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
40 class DistutilsFileError (DistutilsError): |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
41 """Any problems in the filesystem: expected file not found, etc. |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
42 Typically this is for problems that we detect before IOError or |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
43 OSError could be raised.""" |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
44 pass |
|
10435
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
45 |
|
12791
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
46 class DistutilsOptionError (DistutilsError): |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
47 """Syntactic/semantic errors in command options, such as use of |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
48 mutually conflicting options, or inconsistent options, |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
49 badly-spelled values, etc. No distinction is made between option |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
50 values originating in the setup script, the command line, config |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
51 files, or what-have-you -- but if we *know* something originated in |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
52 the setup script, we'll raise DistutilsSetupError instead.""" |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
53 pass |
|
10435
324450ea5450
First checkin of real Distutils code.
Greg Ward <gward@python.net>
parents:
diff
changeset
|
54 |
|
12791
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
55 class DistutilsSetupError (DistutilsError): |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
56 """For errors that can be definitely blamed on the setup script, |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
57 such as invalid keyword arguments to 'setup()'.""" |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
58 pass |
|
11193
89961b6813ac
Added DistutilsExecError, DistutilsValueError.
Greg Ward <gward@python.net>
parents:
11115
diff
changeset
|
59 |
|
12791
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
60 class DistutilsPlatformError (DistutilsError): |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
61 """We don't know how to do something on the current platform (but |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
62 we do know how to do it on some platform) -- eg. trying to compile |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
63 C files on a platform not supported by a CCompiler subclass.""" |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
64 pass |
|
11115
dcc09228a3d2
Don't pollute importer's namespace with type objects from types modules.
Greg Ward <gward@python.net>
parents:
10435
diff
changeset
|
65 |
|
12791
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
66 class DistutilsExecError (DistutilsError): |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
67 """Any problems executing an external program (such as the C |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
68 compiler, when compiling C files).""" |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
69 pass |
|
11193
89961b6813ac
Added DistutilsExecError, DistutilsValueError.
Greg Ward <gward@python.net>
parents:
11115
diff
changeset
|
70 |
|
12791
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
71 class DistutilsInternalError (DistutilsError): |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
72 """Internal inconsistencies or impossibilities (obviously, this |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
73 should never be seen if the code is working!).""" |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
74 pass |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
75 |
|
13750
dfdb911cbec2
Added DistutilsTemplateError.
Greg Ward <gward@python.net>
parents:
13012
diff
changeset
|
76 class DistutilsTemplateError (DistutilsError): |
|
dfdb911cbec2
Added DistutilsTemplateError.
Greg Ward <gward@python.net>
parents:
13012
diff
changeset
|
77 """Syntax error in a file list template.""" |
|
dfdb911cbec2
Added DistutilsTemplateError.
Greg Ward <gward@python.net>
parents:
13012
diff
changeset
|
78 |
|
12157
be2f003d47cc
Added DistutilsInternalError.
Greg Ward <gward@python.net>
parents:
11897
diff
changeset
|
79 |
|
12791
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
80 # Exception classes used by the CCompiler implementation classes |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
81 class CCompilerError (Exception): |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
82 """Some compile/link operation failed.""" |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
83 |
|
13012
9076efac8420
Added PreprocessError and UnknownFileError (both used by CCompiler).
Greg Ward <gward@python.net>
parents:
12791
diff
changeset
|
84 class PreprocessError (CCompilerError): |
|
9076efac8420
Added PreprocessError and UnknownFileError (both used by CCompiler).
Greg Ward <gward@python.net>
parents:
12791
diff
changeset
|
85 """Failure to preprocess one or more C/C++ files.""" |
|
9076efac8420
Added PreprocessError and UnknownFileError (both used by CCompiler).
Greg Ward <gward@python.net>
parents:
12791
diff
changeset
|
86 |
|
12791
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
87 class CompileError (CCompilerError): |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
88 """Failure to compile one or more C/C++ source files.""" |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
89 |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
90 class LibError (CCompilerError): |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
91 """Failure to create a static library from one or more C/C++ object |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
92 files.""" |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
93 |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
94 class LinkError (CCompilerError): |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
95 """Failure to link one or more C/C++ object files into an executable |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
96 or shared library file.""" |
|
937f9859c9de
Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
Greg Ward <gward@python.net>
parents:
12408
diff
changeset
|
97 |
|
13012
9076efac8420
Added PreprocessError and UnknownFileError (both used by CCompiler).
Greg Ward <gward@python.net>
parents:
12791
diff
changeset
|
98 class UnknownFileError (CCompilerError): |
|
9076efac8420
Added PreprocessError and UnknownFileError (both used by CCompiler).
Greg Ward <gward@python.net>
parents:
12791
diff
changeset
|
99 """Attempt to process an unknown file type.""" |
