Greg Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 1 | """distutils.errors |
| 2 | |
| 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). |
| 7 | |
Andrew M. Kuchling | f6756e8 | 2002-11-14 01:58:48 +0000 | [diff] [blame] | 8 | This module is safe to use in "from ... import *" mode; it only exports |
Greg Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 9 | symbols whose names start with "Distutils" and end with "Error".""" |
| 10 | |
Greg Ward | 3ce77fd | 2000-03-02 01:49:45 +0000 | [diff] [blame] | 11 | __revision__ = "$Id$" |
Greg Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 12 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 13 | class DistutilsError (Exception): |
| 14 | """The root of all Distutils evil.""" |
| 15 | pass |
Greg Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 16 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 17 | class 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 Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 21 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 22 | class 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 Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 28 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 29 | class DistutilsGetoptError (DistutilsError): |
| 30 | """The option table provided to 'fancy_getopt()' is bogus.""" |
| 31 | pass |
Greg Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 32 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 33 | class DistutilsArgError (DistutilsError): |
| 34 | """Raised by fancy_getopt in response to getopt.error -- ie. an |
| 35 | error in the command line usage.""" |
| 36 | pass |
Greg Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 37 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 38 | class 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 Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 43 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 44 | class 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 Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 52 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 53 | class 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 Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 57 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 58 | class 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 Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 63 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 64 | class DistutilsExecError (DistutilsError): |
| 65 | """Any problems executing an external program (such as the C |
| 66 | compiler, when compiling C files).""" |
| 67 | pass |
Greg Ward | 8c66b69 | 1999-08-14 23:43:45 +0000 | [diff] [blame] | 68 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 69 | class DistutilsInternalError (DistutilsError): |
| 70 | """Internal inconsistencies or impossibilities (obviously, this |
| 71 | should never be seen if the code is working!).""" |
| 72 | pass |
Greg Ward | ccbb3f0 | 1999-07-10 02:01:44 +0000 | [diff] [blame] | 73 | |
Greg Ward | 58bff53 | 2000-07-30 01:03:31 +0000 | [diff] [blame] | 74 | class DistutilsTemplateError (DistutilsError): |
| 75 | """Syntax error in a file list template.""" |
| 76 | |
Greg Ward | 8c66b69 | 1999-08-14 23:43:45 +0000 | [diff] [blame] | 77 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 78 | # Exception classes used by the CCompiler implementation classes |
| 79 | class CCompilerError (Exception): |
| 80 | """Some compile/link operation failed.""" |
Greg Ward | 318a9d7 | 2000-03-31 02:57:31 +0000 | [diff] [blame] | 81 | |
Greg Ward | 68ff615 | 2000-06-25 02:12:14 +0000 | [diff] [blame] | 82 | class PreprocessError (CCompilerError): |
| 83 | """Failure to preprocess one or more C/C++ files.""" |
| 84 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 85 | class CompileError (CCompilerError): |
| 86 | """Failure to compile one or more C/C++ source files.""" |
| 87 | |
| 88 | class LibError (CCompilerError): |
| 89 | """Failure to create a static library from one or more C/C++ object |
| 90 | files.""" |
| 91 | |
| 92 | class LinkError (CCompilerError): |
| 93 | """Failure to link one or more C/C++ object files into an executable |
| 94 | or shared library file.""" |
| 95 | |
Greg Ward | 68ff615 | 2000-06-25 02:12:14 +0000 | [diff] [blame] | 96 | class UnknownFileError (CCompilerError): |
| 97 | """Attempt to process an unknown file type.""" |