summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command/build_clib.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/command/build_clib.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/command/build_clib.py')
-rw-r--r--Lib/distutils/command/build_clib.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/distutils/command/build_clib.py b/Lib/distutils/command/build_clib.py
index 2311187..3117073 100644
--- a/Lib/distutils/command/build_clib.py
+++ b/Lib/distutils/command/build_clib.py
@@ -115,33 +115,33 @@ class build_clib (Command):
"""Ensure that the list of libraries (presumably provided as a
command option 'libraries') is valid, i.e. it is a list of
2-tuples, where the tuples are (library_name, build_info_dict).
- Raise DistutilsValueError if the structure is invalid anywhere;
+ Raise DistutilsSetupError if the structure is invalid anywhere;
just returns otherwise."""
# Yechh, blecch, ackk: this is ripped straight out of build_ext.py,
# with only names changed to protect the innocent!
if type (libraries) is not ListType:
- raise DistutilsValueError, \
+ raise DistutilsSetupError, \
"'libraries' option must be a list of tuples"
for lib in libraries:
if type (lib) is not TupleType and len (lib) != 2:
- raise DistutilsValueError, \
+ raise DistutilsSetupError, \
"each element of 'libraries' must a 2-tuple"
if type (lib[0]) is not StringType:
- raise DistutilsValueError, \
+ raise DistutilsSetupError, \
"first element of each tuple in 'libraries' " + \
"must be a string (the library name)"
if '/' in lib[0] or (os.sep != '/' and os.sep in lib[0]):
- raise DistutilsValueError, \
+ raise DistutilsSetupError, \
("bad library name '%s': " +
"may not contain directory separators") % \
lib[0]
if type (lib[1]) is not DictionaryType:
- raise DistutilsValueError, \
+ raise DistutilsSetupError, \
"second element of each tuple in 'libraries' " + \
"must be a dictionary (build info)"
# for lib
@@ -171,7 +171,7 @@ class build_clib (Command):
for (lib_name, build_info) in libraries:
sources = build_info.get ('sources')
if sources is None or type (sources) not in (ListType, TupleType):
- raise DistutilsValueError, \
+ raise DistutilsSetupError, \
("in 'libraries' option (library '%s'), " +
"'sources' must be present and must be " +
"a list of source filenames") % lib_name