blob: 963d83377c08f23ec39e05b43eacca0f5a329225 [file] [log] [blame]
Greg Ward2689e3d1999-03-22 14:52:19 +00001"""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
Andrew M. Kuchlingf6756e82002-11-14 01:58:48 +00008This module is safe to use in "from ... import *" mode; it only exports
Greg Ward2689e3d1999-03-22 14:52:19 +00009symbols whose names start with "Distutils" and end with "Error"."""
10
Greg Ward3ce77fd2000-03-02 01:49:45 +000011__revision__ = "$Id$"
Greg Ward2689e3d1999-03-22 14:52:19 +000012
Greg Wardc1cb0492000-05-30 02:02:14 +000013class DistutilsError (Exception):
14 """The root of all Distutils evil."""
15 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000016
Greg Wardc1cb0492000-05-30 02:02:14 +000017class DistutilsModuleError (DistutilsError):
18 """Unable to load an expected module, or to find an expected class
19 within some module (in particular, command modules and classes)."""
20 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000021
Greg Wardc1cb0492000-05-30 02:02:14 +000022class DistutilsClassError (DistutilsError):
23 """Some command class (or possibly distribution class, if anyone
24 feels a need to subclass Distribution) is found not to be holding
25 up its end of the bargain, ie. implementing some part of the
26 "command "interface."""
27 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000028
Greg Wardc1cb0492000-05-30 02:02:14 +000029class DistutilsGetoptError (DistutilsError):
30 """The option table provided to 'fancy_getopt()' is bogus."""
31 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000032
Greg Wardc1cb0492000-05-30 02:02:14 +000033class DistutilsArgError (DistutilsError):
34 """Raised by fancy_getopt in response to getopt.error -- ie. an
35 error in the command line usage."""
36 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000037
Greg Wardc1cb0492000-05-30 02:02:14 +000038class DistutilsFileError (DistutilsError):
39 """Any problems in the filesystem: expected file not found, etc.
40 Typically this is for problems that we detect before IOError or
41 OSError could be raised."""
42 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000043
Greg Wardc1cb0492000-05-30 02:02:14 +000044class DistutilsOptionError (DistutilsError):
45 """Syntactic/semantic errors in command options, such as use of
46 mutually conflicting options, or inconsistent options,
47 badly-spelled values, etc. No distinction is made between option
48 values originating in the setup script, the command line, config
49 files, or what-have-you -- but if we *know* something originated in
50 the setup script, we'll raise DistutilsSetupError instead."""
51 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000052
Greg Wardc1cb0492000-05-30 02:02:14 +000053class DistutilsSetupError (DistutilsError):
54 """For errors that can be definitely blamed on the setup script,
55 such as invalid keyword arguments to 'setup()'."""
56 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000057
Greg Wardc1cb0492000-05-30 02:02:14 +000058class DistutilsPlatformError (DistutilsError):
59 """We don't know how to do something on the current platform (but
60 we do know how to do it on some platform) -- eg. trying to compile
61 C files on a platform not supported by a CCompiler subclass."""
62 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000063
Greg Wardc1cb0492000-05-30 02:02:14 +000064class DistutilsExecError (DistutilsError):
65 """Any problems executing an external program (such as the C
66 compiler, when compiling C files)."""
67 pass
Greg Ward8c66b691999-08-14 23:43:45 +000068
Greg Wardc1cb0492000-05-30 02:02:14 +000069class DistutilsInternalError (DistutilsError):
70 """Internal inconsistencies or impossibilities (obviously, this
71 should never be seen if the code is working!)."""
72 pass
Greg Wardccbb3f01999-07-10 02:01:44 +000073
Greg Ward58bff532000-07-30 01:03:31 +000074class DistutilsTemplateError (DistutilsError):
75 """Syntax error in a file list template."""
76
Greg Ward8c66b691999-08-14 23:43:45 +000077
Greg Wardc1cb0492000-05-30 02:02:14 +000078# Exception classes used by the CCompiler implementation classes
79class CCompilerError (Exception):
80 """Some compile/link operation failed."""
Greg Ward318a9d72000-03-31 02:57:31 +000081
Greg Ward68ff6152000-06-25 02:12:14 +000082class PreprocessError (CCompilerError):
83 """Failure to preprocess one or more C/C++ files."""
84
Greg Wardc1cb0492000-05-30 02:02:14 +000085class CompileError (CCompilerError):
86 """Failure to compile one or more C/C++ source files."""
87
88class LibError (CCompilerError):
89 """Failure to create a static library from one or more C/C++ object
90 files."""
91
92class LinkError (CCompilerError):
93 """Failure to link one or more C/C++ object files into an executable
94 or shared library file."""
95
Greg Ward68ff6152000-06-25 02:12:14 +000096class UnknownFileError (CCompilerError):
97 """Attempt to process an unknown file type."""