Home | History | Annotate | Download | only in distutils
      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 
      8 This module is safe to use in "from ... import *" mode; it only exports
      9 symbols whose names start with "Distutils" and end with "Error"."""
     10 
     11 __revision__ = "$Id$"
     12 
     13 class DistutilsError(Exception):
     14     """The root of all Distutils evil."""
     15 
     16 class DistutilsModuleError(DistutilsError):
     17     """Unable to load an expected module, or to find an expected class
     18     within some module (in particular, command modules and classes)."""
     19 
     20 class DistutilsClassError(DistutilsError):
     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."""
     25 
     26 class DistutilsGetoptError(DistutilsError):
     27     """The option table provided to 'fancy_getopt()' is bogus."""
     28 
     29 class DistutilsArgError(DistutilsError):
     30     """Raised by fancy_getopt in response to getopt.error -- ie. an
     31     error in the command line usage."""
     32 
     33 class DistutilsFileError(DistutilsError):
     34     """Any problems in the filesystem: expected file not found, etc.
     35     Typically this is for problems that we detect before IOError or
     36     OSError could be raised."""
     37 
     38 class DistutilsOptionError(DistutilsError):
     39     """Syntactic/semantic errors in command options, such as use of
     40     mutually conflicting options, or inconsistent options,
     41     badly-spelled values, etc.  No distinction is made between option
     42     values originating in the setup script, the command line, config
     43     files, or what-have-you -- but if we *know* something originated in
     44     the setup script, we'll raise DistutilsSetupError instead."""
     45 
     46 class DistutilsSetupError(DistutilsError):
     47     """For errors that can be definitely blamed on the setup script,
     48     such as invalid keyword arguments to 'setup()'."""
     49 
     50 class DistutilsPlatformError(DistutilsError):
     51     """We don't know how to do something on the current platform (but
     52     we do know how to do it on some platform) -- eg. trying to compile
     53     C files on a platform not supported by a CCompiler subclass."""
     54 
     55 class DistutilsExecError(DistutilsError):
     56     """Any problems executing an external program (such as the C
     57     compiler, when compiling C files)."""
     58 
     59 class DistutilsInternalError(DistutilsError):
     60     """Internal inconsistencies or impossibilities (obviously, this
     61     should never be seen if the code is working!)."""
     62 
     63 class DistutilsTemplateError(DistutilsError):
     64     """Syntax error in a file list template."""
     65 
     66 class DistutilsByteCompileError(DistutilsError):
     67     """Byte compile error."""
     68 
     69 # Exception classes used by the CCompiler implementation classes
     70 class CCompilerError(Exception):
     71     """Some compile/link operation failed."""
     72 
     73 class PreprocessError(CCompilerError):
     74     """Failure to preprocess one or more C/C++ files."""
     75 
     76 class CompileError(CCompilerError):
     77     """Failure to compile one or more C/C++ source files."""
     78 
     79 class LibError(CCompilerError):
     80     """Failure to create a static library from one or more C/C++ object
     81     files."""
     82 
     83 class LinkError(CCompilerError):
     84     """Failure to link one or more C/C++ object files into an executable
     85     or shared library file."""
     86 
     87 class UnknownFileError(CCompilerError):
     88     """Attempt to process an unknown file type."""
     89