• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1"""distutils.errors
2
3Provides exceptions used by the Distutils modules.  Note that Distutils
4modules may raise standard exceptions; in particular, SystemExit is
5usually raised for errors that are obviously the end-user's fault
6(eg. bad command-line arguments).
7
8This module is safe to use in "from ... import *" mode; it only exports
9symbols whose names start with "Distutils" and end with "Error"."""
10
11__revision__ = "$Id$"
12
13class DistutilsError(Exception):
14    """The root of all Distutils evil."""
15
16class 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)."""
19
20class 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."""
25
26class DistutilsGetoptError(DistutilsError):
27    """The option table provided to 'fancy_getopt()' is bogus."""
28
29class DistutilsArgError(DistutilsError):
30    """Raised by fancy_getopt in response to getopt.error -- ie. an
31    error in the command line usage."""
32
33class 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."""
37
38class 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."""
45
46class DistutilsSetupError(DistutilsError):
47    """For errors that can be definitely blamed on the setup script,
48    such as invalid keyword arguments to 'setup()'."""
49
50class 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."""
54
55class DistutilsExecError(DistutilsError):
56    """Any problems executing an external program (such as the C
57    compiler, when compiling C files)."""
58
59class DistutilsInternalError(DistutilsError):
60    """Internal inconsistencies or impossibilities (obviously, this
61    should never be seen if the code is working!)."""
62
63class DistutilsTemplateError(DistutilsError):
64    """Syntax error in a file list template."""
65
66class DistutilsByteCompileError(DistutilsError):
67    """Byte compile error."""
68
69# Exception classes used by the CCompiler implementation classes
70class CCompilerError(Exception):
71    """Some compile/link operation failed."""
72
73class PreprocessError(CCompilerError):
74    """Failure to preprocess one or more C/C++ files."""
75
76class CompileError(CCompilerError):
77    """Failure to compile one or more C/C++ source files."""
78
79class LibError(CCompilerError):
80    """Failure to create a static library from one or more C/C++ object
81    files."""
82
83class LinkError(CCompilerError):
84    """Failure to link one or more C/C++ object files into an executable
85    or shared library file."""
86
87class UnknownFileError(CCompilerError):
88    """Attempt to process an unknown file type."""
89