Skip to content

Commit 3fe42b9

Browse files
committed
Move compiler execeptions to their package.
1 parent 52dad74 commit 3fe42b9

File tree

2 files changed

+38
-27
lines changed

2 files changed

+38
-27
lines changed

distutils/compilers/C/errors.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
class Error(Exception):
2+
"""Some compile/link operation failed."""
3+
4+
5+
class PreprocessError(Error):
6+
"""Failure to preprocess one or more C/C++ files."""
7+
8+
9+
class CompileError(Error):
10+
"""Failure to compile one or more C/C++ source files."""
11+
12+
13+
class LibError(Error):
14+
"""Failure to create a static library from one or more C/C++ object
15+
files."""
16+
17+
18+
class LinkError(Error):
19+
"""Failure to link one or more C/C++ object files into an executable
20+
or shared library file."""
21+
22+
23+
class UnknownFileType(Error):
24+
"""Attempt to process an unknown file type."""

distutils/errors.py

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@
55
including :exc:`SystemExit`.
66
"""
77

8+
# compiler exceptions aliased for compatibility
9+
from .compilers.C.errors import (
10+
CompileError, # noqa: F401
11+
LibError, # noqa: F401
12+
LinkError, # noqa: F401
13+
PreprocessError, # noqa: F401
14+
)
15+
from .compilers.C.errors import (
16+
Error as CCompilerError, # noqa: F401
17+
)
18+
from .compilers.C.errors import (
19+
UnknownFileType as UnknownFileError, # noqa: F401
20+
)
21+
822

923
class DistutilsError(Exception):
1024
"""The root of all Distutils evil."""
@@ -95,30 +109,3 @@ class DistutilsTemplateError(DistutilsError):
95109

96110
class DistutilsByteCompileError(DistutilsError):
97111
"""Byte compile error."""
98-
99-
100-
# Exception classes used by the CCompiler implementation classes
101-
class CCompilerError(Exception):
102-
"""Some compile/link operation failed."""
103-
104-
105-
class PreprocessError(CCompilerError):
106-
"""Failure to preprocess one or more C/C++ files."""
107-
108-
109-
class CompileError(CCompilerError):
110-
"""Failure to compile one or more C/C++ source files."""
111-
112-
113-
class LibError(CCompilerError):
114-
"""Failure to create a static library from one or more C/C++ object
115-
files."""
116-
117-
118-
class LinkError(CCompilerError):
119-
"""Failure to link one or more C/C++ object files into an executable
120-
or shared library file."""
121-
122-
123-
class UnknownFileError(CCompilerError):
124-
"""Attempt to process an unknown file type."""

0 commit comments

Comments
 (0)