You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
3.5 KiB

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