blob: acecacccb5641e92f4fcef936e212fee0ec6d0ca [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
Tarek Ziadé36797272010-07-22 12:50:05 +000013class DistutilsError (Exception):
Greg Wardc1cb0492000-05-30 02:02:14 +000014 """The root of all Distutils evil."""
Tarek Ziadé36797272010-07-22 12:50:05 +000015 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000016
Tarek Ziadé36797272010-07-22 12:50:05 +000017class DistutilsModuleError (DistutilsError):
Greg Wardc1cb0492000-05-30 02:02:14 +000018 """Unable to load an expected module, or to find an expected class
19 within some module (in particular, command modules and classes)."""
Tarek Ziadé36797272010-07-22 12:50:05 +000020 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000021
Tarek Ziadé36797272010-07-22 12:50:05 +000022class DistutilsClassError (DistutilsError):
Greg Wardc1cb0492000-05-30 02:02:14 +000023 """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."""
Tarek Ziadé36797272010-07-22 12:50:05 +000027 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000028
Tarek Ziadé36797272010-07-22 12:50:05 +000029class DistutilsGetoptError (DistutilsError):
Greg Wardc1cb0492000-05-30 02:02:14 +000030 """The option table provided to 'fancy_getopt()' is bogus."""
Tarek Ziadé36797272010-07-22 12:50:05 +000031 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000032
Tarek Ziadé36797272010-07-22 12:50:05 +000033class DistutilsArgError (DistutilsError):
Greg Wardc1cb0492000-05-30 02:02:14 +000034 """Raised by fancy_getopt in response to getopt.error -- ie. an
35 error in the command line usage."""
Tarek Ziadé36797272010-07-22 12:50:05 +000036 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000037
Tarek Ziadé36797272010-07-22 12:50:05 +000038class DistutilsFileError (DistutilsError):
Greg Wardc1cb0492000-05-30 02:02:14 +000039 """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."""
Tarek Ziadé36797272010-07-22 12:50:05 +000042 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000043
Tarek Ziadé36797272010-07-22 12:50:05 +000044class DistutilsOptionError (DistutilsError):
Greg Wardc1cb0492000-05-30 02:02:14 +000045 """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."""
Tarek Ziadé36797272010-07-22 12:50:05 +000051 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000052
Tarek Ziadé36797272010-07-22 12:50:05 +000053class DistutilsSetupError (DistutilsError):
Greg Wardc1cb0492000-05-30 02:02:14 +000054 """For errors that can be definitely blamed on the setup script,
55 such as invalid keyword arguments to 'setup()'."""
Tarek Ziadé36797272010-07-22 12:50:05 +000056 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000057
Tarek Ziadé36797272010-07-22 12:50:05 +000058class DistutilsPlatformError (DistutilsError):
Greg Wardc1cb0492000-05-30 02:02:14 +000059 """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."""
Tarek Ziadé36797272010-07-22 12:50:05 +000062 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000063
Tarek Ziadé36797272010-07-22 12:50:05 +000064class DistutilsExecError (DistutilsError):
Greg Wardc1cb0492000-05-30 02:02:14 +000065 """Any problems executing an external program (such as the C
66 compiler, when compiling C files)."""
Tarek Ziadé36797272010-07-22 12:50:05 +000067 pass
Greg Ward8c66b691999-08-14 23:43:45 +000068
Tarek Ziadé36797272010-07-22 12:50:05 +000069class DistutilsInternalError (DistutilsError):
Greg Wardc1cb0492000-05-30 02:02:14 +000070 """Internal inconsistencies or impossibilities (obviously, this
71 should never be seen if the code is working!)."""
Tarek Ziadé36797272010-07-22 12:50:05 +000072 pass
Greg Wardccbb3f01999-07-10 02:01:44 +000073
Tarek Ziadé36797272010-07-22 12:50:05 +000074class DistutilsTemplateError (DistutilsError):
Greg Ward58bff532000-07-30 01:03:31 +000075 """Syntax error in a file list template."""
76
Tarek Ziadé04fe7c02009-10-25 23:08:47 +000077class DistutilsByteCompileError(DistutilsError):
78 """Byte compile error."""
Greg Ward8c66b691999-08-14 23:43:45 +000079
Greg Wardc1cb0492000-05-30 02:02:14 +000080# Exception classes used by the CCompiler implementation classes
Tarek Ziadé36797272010-07-22 12:50:05 +000081class CCompilerError (Exception):
Greg Wardc1cb0492000-05-30 02:02:14 +000082 """Some compile/link operation failed."""
Greg Ward318a9d72000-03-31 02:57:31 +000083
Tarek Ziadé36797272010-07-22 12:50:05 +000084class PreprocessError (CCompilerError):
Greg Ward68ff6152000-06-25 02:12:14 +000085 """Failure to preprocess one or more C/C++ files."""
86
Tarek Ziadé36797272010-07-22 12:50:05 +000087class CompileError (CCompilerError):
Greg Wardc1cb0492000-05-30 02:02:14 +000088 """Failure to compile one or more C/C++ source files."""
89
Tarek Ziadé36797272010-07-22 12:50:05 +000090class LibError (CCompilerError):
Greg Wardc1cb0492000-05-30 02:02:14 +000091 """Failure to create a static library from one or more C/C++ object
92 files."""
93
Tarek Ziadé36797272010-07-22 12:50:05 +000094class LinkError (CCompilerError):
Greg Wardc1cb0492000-05-30 02:02:14 +000095 """Failure to link one or more C/C++ object files into an executable
96 or shared library file."""
97
Tarek Ziadé36797272010-07-22 12:50:05 +000098class UnknownFileError (CCompilerError):
Greg Ward68ff6152000-06-25 02:12:14 +000099 """Attempt to process an unknown file type."""