summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/errors.py
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-04-15 22:15:07 (GMT)
committerGreg Ward <gward@python.net>2000-04-15 22:15:07 (GMT)
commit02a1a2b077e969e5fef8504cece5852bf641552d (patch)
tree4adea05076d4dab820180e6c9290ae9b1d7b28a4 /Lib/distutils/errors.py
parent4a3dd2dcc2fae12b6736822731848c557b80d0e3 (diff)
downloadcpython-02a1a2b077e969e5fef8504cece5852bf641552d.zip
cpython-02a1a2b077e969e5fef8504cece5852bf641552d.tar.gz
cpython-02a1a2b077e969e5fef8504cece5852bf641552d.tar.bz2
Cleaned up/simplified error-handling:
- DistutilsOptionError is now documented as it's actually used, ie. to indicate bogus option values (usually user options, eg. from the command-line) - added DistutilsSetupError to indicate errors that definitely arise in the setup script - got rid of DistutilsValueError, and changed all usage of it to either DistutilsSetupError or ValueError as appropriate - simplified a bunch of option get/set methods in Command and Distribution classes -- just pass on AttributeError most of the time, rather than turning it into something else
Diffstat (limited to 'Lib/distutils/errors.py')
-rw-r--r--Lib/distutils/errors.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/Lib/distutils/errors.py b/Lib/distutils/errors.py
index f9d5c8d..61cdb72 100644
--- a/Lib/distutils/errors.py
+++ b/Lib/distutils/errors.py
@@ -46,15 +46,18 @@ if type (RuntimeError) is types.ClassType:
class DistutilsFileError (DistutilsError):
pass
- # DistutilsOptionError is raised anytime an attempt is made to access
- # (get or set) an option that does not exist for a particular command
- # (or for the distribution itself).
+ # DistutilsOptionError is raised for syntactic/semantic errors in
+ # command options, such as use of mutually conflicting options, or
+ # inconsistent options, badly-spelled values, etc. No distinction is
+ # made between option values originating in the setup script, the
+ # command line, config files, or what-have-you.
class DistutilsOptionError (DistutilsError):
pass
- # DistutilsValueError is raised anytime an option value (presumably
- # provided by setup.py) is invalid.
- class DistutilsValueError (DistutilsError):
+ # DistutilsSetupError is raised for errors that can be definitely
+ # blamed on the setup script, such as invalid keyword arguments to
+ # 'setup()'.
+ class DistutilsSetupError (DistutilsError):
pass
# DistutilsPlatformError is raised when we find that we don't
@@ -82,7 +85,6 @@ else:
DistutilsArgError = 'DistutilsArgError'
DistutilsFileError = 'DistutilsFileError'
DistutilsOptionError = 'DistutilsOptionError'
- DistutilsValueError = 'DistutilsValueError'
DistutilsPlatformError = 'DistutilsPlatformError'
DistutilsExecError = 'DistutilsExecError'
DistutilsInternalError = 'DistutilsInternalError'