codekingpro/portable-devtools
114k
1"""distutils.errors2 3Provides exceptions used by the Distutils modules. Note that Distutils4modules may raise standard exceptions; in particular, SystemExit is5usually raised for errors that are obviously the end-user's fault6(eg. bad command-line arguments).7 8This module is safe to use in "from ... import *" mode; it only exports9symbols whose names start with "Distutils" and end with "Error"."""10 11 12class DistutilsError(Exception):13 """The root of all Distutils evil."""14 15 pass16 17 18class DistutilsModuleError(DistutilsError):19 """Unable to load an expected module, or to find an expected class20 within some module (in particular, command modules and classes)."""21 22 pass23 24 25class DistutilsClassError(DistutilsError):26 """Some command class (or possibly distribution class, if anyone27 feels a need to subclass Distribution) is found not to be holding28 up its end of the bargain, ie. implementing some part of the29 "command "interface."""30 31 pass32 33 34class DistutilsGetoptError(DistutilsError):35 """The option table provided to 'fancy_getopt()' is bogus."""36 37 pass38 39 40class DistutilsArgError(DistutilsError):41 """Raised by fancy_getopt in response to getopt.error -- ie. an42 error in the command line usage."""43 44 pass45 46 47class DistutilsFileError(DistutilsError):48 """Any problems in the filesystem: expected file not found, etc.49 Typically this is for problems that we detect before OSError50 could be raised."""51 52 pass53 54 55class DistutilsOptionError(DistutilsError):56 """Syntactic/semantic errors in command options, such as use of57 mutually conflicting options, or inconsistent options,58 badly-spelled values, etc. No distinction is made between option59 values originating in the setup script, the command line, config60 files, or what-have-you -- but if we *know* something originated in61 the setup script, we'll raise DistutilsSetupError instead."""62 63 pass64 65 66class DistutilsSetupError(DistutilsError):67 """For errors that can be definitely blamed on the setup script,68 such as invalid keyword arguments to 'setup()'."""69 70 pass71 72 73class DistutilsPlatformError(DistutilsError):74 """We don't know how to do something on the current platform (but75 we do know how to do it on some platform) -- eg. trying to compile76 C files on a platform not supported by a CCompiler subclass."""77 78 pass79 80 81class DistutilsExecError(DistutilsError):82 """Any problems executing an external program (such as the C83 compiler, when compiling C files)."""84 85 pass86 87 88class DistutilsInternalError(DistutilsError):89 """Internal inconsistencies or impossibilities (obviously, this90 should never be seen if the code is working!)."""91 92 pass93 94 95class DistutilsTemplateError(DistutilsError):96 """Syntax error in a file list template."""97 98 99class DistutilsByteCompileError(DistutilsError):100 """Byte compile error."""101 102 103# Exception classes used by the CCompiler implementation classes104class CCompilerError(Exception):105 """Some compile/link operation failed."""106 107 108class PreprocessError(CCompilerError):109 """Failure to preprocess one or more C/C++ files."""110 111 112class CompileError(CCompilerError):113 """Failure to compile one or more C/C++ source files."""114 115 116class LibError(CCompilerError):117 """Failure to create a static library from one or more C/C++ object118 files."""119 120 121class LinkError(CCompilerError):122 """Failure to link one or more C/C++ object files into an executable123 or shared library file."""124 125 126class UnknownFileError(CCompilerError):127 """Attempt to process an unknown file type."""128 