move sections
[python/dscho.git] / Lib / distutils / errors.py
blobd9c47c761cb4428cacef0efbe010f78a9d1f930d
1 """distutils.errors
3 Provides exceptions used by the Distutils modules. Note that Distutils
4 modules may raise standard exceptions; in particular, SystemExit is
5 usually raised for errors that are obviously the end-user's fault
6 (eg. bad command-line arguments).
8 This module is safe to use in "from ... import *" mode; it only exports
9 symbols whose names start with "Distutils" and end with "Error"."""
11 __revision__ = "$Id$"
13 class DistutilsError(Exception):
14 """The root of all Distutils evil."""
16 class DistutilsModuleError(DistutilsError):
17 """Unable to load an expected module, or to find an expected class
18 within some module (in particular, command modules and classes)."""
20 class DistutilsClassError(DistutilsError):
21 """Some command class (or possibly distribution class, if anyone
22 feels a need to subclass Distribution) is found not to be holding
23 up its end of the bargain, ie. implementing some part of the
24 "command "interface."""
26 class DistutilsGetoptError(DistutilsError):
27 """The option table provided to 'fancy_getopt()' is bogus."""
29 class DistutilsArgError(DistutilsError):
30 """Raised by fancy_getopt in response to getopt.error -- ie. an
31 error in the command line usage."""
33 class DistutilsFileError(DistutilsError):
34 """Any problems in the filesystem: expected file not found, etc.
35 Typically this is for problems that we detect before IOError or
36 OSError could be raised."""
38 class DistutilsOptionError(DistutilsError):
39 """Syntactic/semantic errors in command options, such as use of
40 mutually conflicting options, or inconsistent options,
41 badly-spelled values, etc. No distinction is made between option
42 values originating in the setup script, the command line, config
43 files, or what-have-you -- but if we *know* something originated in
44 the setup script, we'll raise DistutilsSetupError instead."""
46 class DistutilsSetupError(DistutilsError):
47 """For errors that can be definitely blamed on the setup script,
48 such as invalid keyword arguments to 'setup()'."""
50 class DistutilsPlatformError(DistutilsError):
51 """We don't know how to do something on the current platform (but
52 we do know how to do it on some platform) -- eg. trying to compile
53 C files on a platform not supported by a CCompiler subclass."""
55 class DistutilsExecError(DistutilsError):
56 """Any problems executing an external program (such as the C
57 compiler, when compiling C files)."""
59 class DistutilsInternalError(DistutilsError):
60 """Internal inconsistencies or impossibilities (obviously, this
61 should never be seen if the code is working!)."""
63 class DistutilsTemplateError(DistutilsError):
64 """Syntax error in a file list template."""
66 class DistutilsByteCompileError(DistutilsError):
67 """Byte compile error."""
69 # Exception classes used by the CCompiler implementation classes
70 class CCompilerError(Exception):
71 """Some compile/link operation failed."""
73 class PreprocessError(CCompilerError):
74 """Failure to preprocess one or more C/C++ files."""
76 class CompileError(CCompilerError):
77 """Failure to compile one or more C/C++ source files."""
79 class LibError(CCompilerError):
80 """Failure to create a static library from one or more C/C++ object
81 files."""
83 class LinkError(CCompilerError):
84 """Failure to link one or more C/C++ object files into an executable
85 or shared library file."""
87 class UnknownFileError(CCompilerError):
88 """Attempt to process an unknown file type."""