|
16 | 16 |
|
17 | 17 | if type (RuntimeError) is types.ClassType: |
18 | 18 |
|
19 | | - # DistutilsError is the root of all Distutils evil. |
20 | 19 | class DistutilsError (Exception): |
| 20 | + """The root of all Distutils evil.""" |
21 | 21 | pass |
22 | 22 |
|
23 | | - # DistutilsModuleError is raised if we are unable to load an expected |
24 | | - # module, or find an expected class within some module |
25 | 23 | 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).""" |
26 | 26 | pass |
27 | 27 |
|
28 | | - # DistutilsClassError is raised if we encounter a distribution or command |
29 | | - # class that's not holding up its end of the bargain. |
30 | 28 | 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.""" |
31 | 33 | pass |
32 | 34 |
|
33 | | - # DistutilsGetoptError (help me -- I have JavaProgrammersDisease!) is |
34 | | - # raised if the option table provided to fancy_getopt is bogus. |
35 | 35 | class DistutilsGetoptError (DistutilsError): |
| 36 | + """The option table provided to 'fancy_getopt()' is bogus.""" |
36 | 37 | pass |
37 | 38 |
|
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.) |
41 | 39 | class DistutilsArgError (DistutilsError): |
| 40 | + """Raised by fancy_getopt in response to getopt.error -- ie. an |
| 41 | + error in the command line usage.""" |
42 | 42 | pass |
43 | 43 |
|
44 | | - # DistutilsFileError is raised for any problems in the filesystem: |
45 | | - # expected file not found, etc. |
46 | 44 | 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.""" |
47 | 48 | pass |
48 | 49 |
|
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. |
54 | 50 | 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.""" |
55 | 57 | pass |
56 | 58 |
|
57 | | - # DistutilsSetupError is raised for errors that can be definitely |
58 | | - # blamed on the setup script, such as invalid keyword arguments to |
59 | | - # 'setup()'. |
60 | 59 | class DistutilsSetupError (DistutilsError): |
| 60 | + """For errors that can be definitely blamed on the setup script, |
| 61 | + such as invalid keyword arguments to 'setup()'.""" |
61 | 62 | pass |
62 | 63 |
|
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). |
66 | 64 | 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.""" |
67 | 68 | pass |
68 | 69 |
|
69 | | - # DistutilsExecError is raised if there are any problems executing |
70 | | - # an external program |
71 | 70 | class DistutilsExecError (DistutilsError): |
| 71 | + """Any problems executing an external program (such as the C |
| 72 | + compiler, when compiling C files).""" |
72 | 73 | pass |
73 | 74 |
|
74 | | - # DistutilsInternalError is raised on internal inconsistencies |
75 | | - # or impossibilities |
76 | 75 | class DistutilsInternalError (DistutilsError): |
| 76 | + """Internal inconsistencies or impossibilities (obviously, this |
| 77 | + should never be seen if the code is working!).""" |
77 | 78 | pass |
78 | 79 |
|
79 | 80 | # String-based exceptions |
|
0 commit comments