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