Moved the CCompiler exceptions here, to avoid having to import ccompiler.py

just to get a little exception class.
No more string-based exceptions.
This commit is contained in:
Greg Ward 2000-05-30 02:02:14 +00:00
parent d151711e66
commit c1cb0493f8

View file

@ -12,10 +12,6 @@ symbols whose names start with "Distutils" and end with "Error"."""
__revision__ = "$Id$" __revision__ = "$Id$"
import types
if type (RuntimeError) is types.ClassType:
class DistutilsError (Exception): class DistutilsError (Exception):
"""The root of all Distutils evil.""" """The root of all Distutils evil."""
pass pass
@ -77,17 +73,20 @@ if type (RuntimeError) is types.ClassType:
should never be seen if the code is working!).""" should never be seen if the code is working!)."""
pass pass
# String-based exceptions
else:
DistutilsError = 'DistutilsError'
DistutilsModuleError = 'DistutilsModuleError'
DistutilsClassError = 'DistutilsClassError'
DistutilsGetoptError = 'DistutilsGetoptError'
DistutilsArgError = 'DistutilsArgError'
DistutilsFileError = 'DistutilsFileError'
DistutilsOptionError = 'DistutilsOptionError'
DistutilsPlatformError = 'DistutilsPlatformError'
DistutilsExecError = 'DistutilsExecError'
DistutilsInternalError = 'DistutilsInternalError'
del types # Exception classes used by the CCompiler implementation classes
class CCompilerError (Exception):
"""Some compile/link operation failed."""
class CompileError (CCompilerError):
"""Failure to compile one or more C/C++ source files."""
class LibError (CCompilerError):
"""Failure to create a static library from one or more C/C++ object
files."""
class LinkError (CCompilerError):
"""Failure to link one or more C/C++ object files into an executable
or shared library file."""