Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eacdea8

Browse files
committed
Reformatted all exception documentation as docstrings.
1 parent 02a1a2b commit eacdea8

1 file changed

Lines changed: 28 additions & 27 deletions

File tree

Lib/distutils/errors.py

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,64 +16,65 @@
1616

1717
if type (RuntimeError) is types.ClassType:
1818

19-
# DistutilsError is the root of all Distutils evil.
2019
class DistutilsError (Exception):
20+
"""The root of all Distutils evil."""
2121
pass
2222

23-
# DistutilsModuleError is raised if we are unable to load an expected
24-
# module, or find an expected class within some module
2523
class DistutilsModuleError (DistutilsError):
24+
"""Unable to load an expected module, or to find an expected class
25+
within some module (in particular, command modules and classes)."""
2626
pass
2727

28-
# DistutilsClassError is raised if we encounter a distribution or command
29-
# class that's not holding up its end of the bargain.
3028
class DistutilsClassError (DistutilsError):
29+
"""Some command class (or possibly distribution class, if anyone
30+
feels a need to subclass Distribution) is found not to be holding
31+
up its end of the bargain, ie. implementing some part of the
32+
"command "interface."""
3133
pass
3234

33-
# DistutilsGetoptError (help me -- I have JavaProgrammersDisease!) is
34-
# raised if the option table provided to fancy_getopt is bogus.
3535
class DistutilsGetoptError (DistutilsError):
36+
"""The option table provided to 'fancy_getopt()' is bogus."""
3637
pass
3738

38-
# DistutilsArgError is raised by fancy_getopt in response to getopt.error;
39-
# distutils.core then turns around and raises SystemExit from that. (Thus
40-
# client code should never see DistutilsArgError.)
4139
class DistutilsArgError (DistutilsError):
40+
"""Raised by fancy_getopt in response to getopt.error -- ie. an
41+
error in the command line usage."""
4242
pass
4343

44-
# DistutilsFileError is raised for any problems in the filesystem:
45-
# expected file not found, etc.
4644
class DistutilsFileError (DistutilsError):
45+
"""Any problems in the filesystem: expected file not found, etc.
46+
Typically this is for problems that we detect before IOError or
47+
OSError could be raised."""
4748
pass
4849

49-
# DistutilsOptionError is raised for syntactic/semantic errors in
50-
# command options, such as use of mutually conflicting options, or
51-
# inconsistent options, badly-spelled values, etc. No distinction is
52-
# made between option values originating in the setup script, the
53-
# command line, config files, or what-have-you.
5450
class DistutilsOptionError (DistutilsError):
51+
"""Syntactic/semantic errors in command options, such as use of
52+
mutually conflicting options, or inconsistent options,
53+
badly-spelled values, etc. No distinction is made between option
54+
values originating in the setup script, the command line, config
55+
files, or what-have-you -- but if we *know* something originated in
56+
the setup script, we'll raise DistutilsSetupError instead."""
5557
pass
5658

57-
# DistutilsSetupError is raised for errors that can be definitely
58-
# blamed on the setup script, such as invalid keyword arguments to
59-
# 'setup()'.
6059
class DistutilsSetupError (DistutilsError):
60+
"""For errors that can be definitely blamed on the setup script,
61+
such as invalid keyword arguments to 'setup()'."""
6162
pass
6263

63-
# DistutilsPlatformError is raised when we find that we don't
64-
# know how to do something on the current platform (but we do
65-
# know how to do it on some platform).
6664
class DistutilsPlatformError (DistutilsError):
65+
"""We don't know how to do something on the current platform (but
66+
we do know how to do it on some platform) -- eg. trying to compile
67+
C files on a platform not supported by a CCompiler subclass."""
6768
pass
6869

69-
# DistutilsExecError is raised if there are any problems executing
70-
# an external program
7170
class DistutilsExecError (DistutilsError):
71+
"""Any problems executing an external program (such as the C
72+
compiler, when compiling C files)."""
7273
pass
7374

74-
# DistutilsInternalError is raised on internal inconsistencies
75-
# or impossibilities
7675
class DistutilsInternalError (DistutilsError):
76+
"""Internal inconsistencies or impossibilities (obviously, this
77+
should never be seen if the code is working!)."""
7778
pass
7879

7980
# String-based exceptions

0 commit comments

Comments
 (0)