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 | |
Andrew M. Kuchling | d448f66 | 2002-11-19 13:12:28 +0000 | [diff] [blame] | 11 | # This module should be kept compatible with Python 1.5.2. |
| 12 | |
Greg Ward | 3ce77fd | 2000-03-02 01:49:45 +0000 | [diff] [blame] | 13 | __revision__ = "$Id$" |
Greg Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 14 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 15 | class DistutilsError (Exception): |
| 16 | """The root of all Distutils evil.""" |
| 17 | pass |
Greg Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 18 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 19 | class DistutilsModuleError (DistutilsError): |
| 20 | """Unable to load an expected module, or to find an expected class |
| 21 | within some module (in particular, command modules and classes).""" |
| 22 | pass |
Greg Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 23 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 24 | class DistutilsClassError (DistutilsError): |
| 25 | """Some command class (or possibly distribution class, if anyone |
| 26 | feels a need to subclass Distribution) is found not to be holding |
| 27 | up its end of the bargain, ie. implementing some part of the |
| 28 | "command "interface.""" |
| 29 | pass |
Greg Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 30 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 31 | class DistutilsGetoptError (DistutilsError): |
| 32 | """The option table provided to 'fancy_getopt()' is bogus.""" |
| 33 | pass |
Greg Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 34 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 35 | class DistutilsArgError (DistutilsError): |
| 36 | """Raised by fancy_getopt in response to getopt.error -- ie. an |
| 37 | error in the command line usage.""" |
| 38 | pass |
Greg Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 39 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 40 | class DistutilsFileError (DistutilsError): |
| 41 | """Any problems in the filesystem: expected file not found, etc. |
| 42 | Typically this is for problems that we detect before IOError or |
| 43 | OSError could be raised.""" |
| 44 | pass |
Greg Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 45 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 46 | class DistutilsOptionError (DistutilsError): |
| 47 | """Syntactic/semantic errors in command options, such as use of |
| 48 | mutually conflicting options, or inconsistent options, |
| 49 | badly-spelled values, etc. No distinction is made between option |
| 50 | values originating in the setup script, the command line, config |
| 51 | files, or what-have-you -- but if we *know* something originated in |
| 52 | the setup script, we'll raise DistutilsSetupError instead.""" |
| 53 | pass |
Greg Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 54 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 55 | class DistutilsSetupError (DistutilsError): |
| 56 | """For errors that can be definitely blamed on the setup script, |
| 57 | such as invalid keyword arguments to 'setup()'.""" |
| 58 | pass |
Greg Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 59 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 60 | class DistutilsPlatformError (DistutilsError): |
| 61 | """We don't know how to do something on the current platform (but |
| 62 | we do know how to do it on some platform) -- eg. trying to compile |
| 63 | C files on a platform not supported by a CCompiler subclass.""" |
| 64 | pass |
Greg Ward | 2689e3d | 1999-03-22 14:52:19 +0000 | [diff] [blame] | 65 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 66 | class DistutilsExecError (DistutilsError): |
| 67 | """Any problems executing an external program (such as the C |
| 68 | compiler, when compiling C files).""" |
| 69 | pass |
Greg Ward | 8c66b69 | 1999-08-14 23:43:45 +0000 | [diff] [blame] | 70 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 71 | class DistutilsInternalError (DistutilsError): |
| 72 | """Internal inconsistencies or impossibilities (obviously, this |
| 73 | should never be seen if the code is working!).""" |
| 74 | pass |
Greg Ward | ccbb3f0 | 1999-07-10 02:01:44 +0000 | [diff] [blame] | 75 | |
Greg Ward | 58bff53 | 2000-07-30 01:03:31 +0000 | [diff] [blame] | 76 | class DistutilsTemplateError (DistutilsError): |
| 77 | """Syntax error in a file list template.""" |
| 78 | |
Greg Ward | 8c66b69 | 1999-08-14 23:43:45 +0000 | [diff] [blame] | 79 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 80 | # Exception classes used by the CCompiler implementation classes |
| 81 | class CCompilerError (Exception): |
| 82 | """Some compile/link operation failed.""" |
Greg Ward | 318a9d7 | 2000-03-31 02:57:31 +0000 | [diff] [blame] | 83 | |
Greg Ward | 68ff615 | 2000-06-25 02:12:14 +0000 | [diff] [blame] | 84 | class PreprocessError (CCompilerError): |
| 85 | """Failure to preprocess one or more C/C++ files.""" |
| 86 | |
Greg Ward | c1cb049 | 2000-05-30 02:02:14 +0000 | [diff] [blame] | 87 | class CompileError (CCompilerError): |
| 88 | """Failure to compile one or more C/C++ source files.""" |
| 89 | |
| 90 | class LibError (CCompilerError): |
| 91 | """Failure to create a static library from one or more C/C++ object |
| 92 | files.""" |
| 93 | |
| 94 | class LinkError (CCompilerError): |
| 95 | """Failure to link one or more C/C++ object files into an executable |
| 96 | or shared library file.""" |
| 97 | |
Greg Ward | 68ff615 | 2000-06-25 02:12:14 +0000 | [diff] [blame] | 98 | class UnknownFileError (CCompilerError): |
| 99 | """Attempt to process an unknown file type.""" |