mirror of
https://github.com/python/cpython.git
synced 2025-10-23 07:02:24 +00:00
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:
parent
d151711e66
commit
c1cb0493f8
1 changed files with 65 additions and 66 deletions
|
@ -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."""
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue