errors.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. """
  2. Exceptions used by the Distutils modules.
  3. Distutils modules may raise these or standard exceptions,
  4. including :exc:`SystemExit`.
  5. """
  6. # compiler exceptions aliased for compatibility
  7. from .compilers.C.errors import CompileError as CompileError
  8. from .compilers.C.errors import Error as _Error
  9. from .compilers.C.errors import LibError as LibError
  10. from .compilers.C.errors import LinkError as LinkError
  11. from .compilers.C.errors import PreprocessError as PreprocessError
  12. from .compilers.C.errors import UnknownFileType as _UnknownFileType
  13. CCompilerError = _Error
  14. UnknownFileError = _UnknownFileType
  15. class DistutilsError(Exception):
  16. """The root of all Distutils evil."""
  17. pass
  18. class DistutilsModuleError(DistutilsError):
  19. """Unable to load an expected module, or to find an expected class
  20. within some module (in particular, command modules and classes)."""
  21. pass
  22. class DistutilsClassError(DistutilsError):
  23. """Some command class (or possibly distribution class, if anyone
  24. feels a need to subclass Distribution) is found not to be holding
  25. up its end of the bargain, ie. implementing some part of the
  26. "command "interface."""
  27. pass
  28. class DistutilsGetoptError(DistutilsError):
  29. """The option table provided to 'fancy_getopt()' is bogus."""
  30. pass
  31. class DistutilsArgError(DistutilsError):
  32. """Raised by fancy_getopt in response to getopt.error -- ie. an
  33. error in the command line usage."""
  34. pass
  35. class DistutilsFileError(DistutilsError):
  36. """Any problems in the filesystem: expected file not found, etc.
  37. Typically this is for problems that we detect before OSError
  38. could be raised."""
  39. pass
  40. class DistutilsOptionError(DistutilsError):
  41. """Syntactic/semantic errors in command options, such as use of
  42. mutually conflicting options, or inconsistent options,
  43. badly-spelled values, etc. No distinction is made between option
  44. values originating in the setup script, the command line, config
  45. files, or what-have-you -- but if we *know* something originated in
  46. the setup script, we'll raise DistutilsSetupError instead."""
  47. pass
  48. class DistutilsSetupError(DistutilsError):
  49. """For errors that can be definitely blamed on the setup script,
  50. such as invalid keyword arguments to 'setup()'."""
  51. pass
  52. class DistutilsPlatformError(DistutilsError):
  53. """We don't know how to do something on the current platform (but
  54. we do know how to do it on some platform) -- eg. trying to compile
  55. C files on a platform not supported by a CCompiler subclass."""
  56. pass
  57. class DistutilsExecError(DistutilsError):
  58. """Any problems executing an external program (such as the C
  59. compiler, when compiling C files)."""
  60. pass
  61. class DistutilsInternalError(DistutilsError):
  62. """Internal inconsistencies or impossibilities (obviously, this
  63. should never be seen if the code is working!)."""
  64. pass
  65. class DistutilsTemplateError(DistutilsError):
  66. """Syntax error in a file list template."""
  67. class DistutilsByteCompileError(DistutilsError):
  68. """Byte compile error."""