[Python-checkins] CVS: distutils/distutils/command build_clib.py,1.12,1.13 build_ext.py,1.31,1.32
Greg Ward
python-dev@python.org
2000年4月15日 18:15:10 -0400 (EDT)
- Previous message: [Python-checkins] CVS: distutils/distutils cmd.py,1.5,1.6 dist.py,1.3,1.4 errors.py,1.5,1.6 msvccompiler.py,1.25,1.26 util.py,1.27,1.28
- Next message: [Python-checkins] CVS: distutils/distutils errors.py,1.6,1.7
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /projects/cvsroot/distutils/distutils/command
In directory kaluha:/tmp/cvs-serv8562/command
Modified Files:
build_clib.py build_ext.py
Log Message:
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
Index: build_clib.py
===================================================================
RCS file: /projects/cvsroot/distutils/distutils/command/build_clib.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** build_clib.py 2000年04月10日 00:19:42 1.12
--- build_clib.py 2000年04月15日 22:15:07 1.13
***************
*** 8,12 ****
# fleshed out 2000年02月03日-04
! __revision__ = "$Id: build_clib.py,v 1.12 2000年04月10日 00:19:42 gward Exp $"
--- 8,12 ----
# fleshed out 2000年02月03日-04
! __revision__ = "$Id: build_clib.py,v 1.13 2000年04月15日 22:15:07 gward Exp $"
***************
*** 116,120 ****
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;
just returns otherwise."""
--- 116,120 ----
command option 'libraries') is valid, i.e. it is a list of
2-tuples, where the tuples are (library_name, build_info_dict).
! Raise DistutilsSetupError if the structure is invalid anywhere;
just returns otherwise."""
***************
*** 123,140 ****
if type (libraries) is not ListType:
! raise DistutilsValueError, \
"'libraries' option must be a list of tuples"
for lib in libraries:
if type (lib) is not TupleType and len (lib) != 2:
! raise DistutilsValueError, \
"each element of 'libraries' must a 2-tuple"
if type (lib[0]) is not StringType:
! raise DistutilsValueError, \
"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, \
("bad library name '%s': " +
"may not contain directory separators") % \
--- 123,140 ----
if type (libraries) is not ListType:
! 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 DistutilsSetupError, \
"each element of 'libraries' must a 2-tuple"
if type (lib[0]) is not StringType:
! 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 DistutilsSetupError, \
("bad library name '%s': " +
"may not contain directory separators") % \
***************
*** 142,146 ****
if type (lib[1]) is not DictionaryType:
! raise DistutilsValueError, \
"second element of each tuple in 'libraries' " + \
"must be a dictionary (build info)"
--- 142,146 ----
if type (lib[1]) is not DictionaryType:
! raise DistutilsSetupError, \
"second element of each tuple in 'libraries' " + \
"must be a dictionary (build info)"
***************
*** 172,176 ****
sources = build_info.get ('sources')
if sources is None or type (sources) not in (ListType, TupleType):
! raise DistutilsValueError, \
("in 'libraries' option (library '%s'), " +
"'sources' must be present and must be " +
--- 172,176 ----
sources = build_info.get ('sources')
if sources is None or type (sources) not in (ListType, TupleType):
! raise DistutilsSetupError, \
("in 'libraries' option (library '%s'), " +
"'sources' must be present and must be " +
Index: build_ext.py
===================================================================
RCS file: /projects/cvsroot/distutils/distutils/command/build_ext.py,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** build_ext.py 2000年04月14日 00:50:49 1.31
--- build_ext.py 2000年04月15日 22:15:07 1.32
***************
*** 7,11 ****
# created 1999年08月09日, Greg Ward
! __revision__ = "$Id: build_ext.py,v 1.31 2000年04月14日 00:50:49 gward Exp $"
import sys, os, string, re
--- 7,11 ----
# created 1999年08月09日, Greg Ward
! __revision__ = "$Id: build_ext.py,v 1.32 2000年04月15日 22:15:07 gward Exp $"
import sys, os, string, re
***************
*** 206,229 ****
command option 'extensions') is valid, i.e. it is a list of
2-tuples, where the tuples are (extension_name, build_info_dict).
! Raise DistutilsValueError if the structure is invalid anywhere;
just returns otherwise."""
if type (extensions) is not ListType:
! raise DistutilsValueError, \
"'ext_modules' option must be a list of tuples"
for ext in extensions:
if type (ext) is not TupleType and len (ext) != 2:
! raise DistutilsValueError, \
"each element of 'ext_modules' option must be a 2-tuple"
if not (type (ext[0]) is StringType and
extension_name_re.match (ext[0])):
! raise DistutilsValueError, \
"first element of each tuple in 'ext_modules' " + \
"must be the extension name (a string)"
if type (ext[1]) is not DictionaryType:
! raise DistutilsValueError, \
"second element of each tuple in 'ext_modules' " + \
"must be a dictionary (build info)"
--- 206,229 ----
command option 'extensions') is valid, i.e. it is a list of
2-tuples, where the tuples are (extension_name, build_info_dict).
! Raise DistutilsSetupError if the structure is invalid anywhere;
just returns otherwise."""
if type (extensions) is not ListType:
! raise DistutilsSetupError, \
"'ext_modules' option must be a list of tuples"
for ext in extensions:
if type (ext) is not TupleType and len (ext) != 2:
! raise DistutilsSetupError, \
"each element of 'ext_modules' option must be a 2-tuple"
if not (type (ext[0]) is StringType and
extension_name_re.match (ext[0])):
! raise DistutilsSetupError, \
"first element of each tuple in 'ext_modules' " + \
"must be the extension name (a string)"
if type (ext[1]) is not DictionaryType:
! raise DistutilsSetupError, \
"second element of each tuple in 'ext_modules' " + \
"must be a dictionary (build info)"
***************
*** 275,279 ****
sources = build_info.get ('sources')
if sources is None or type (sources) not in (ListType, TupleType):
! raise DistutilsValueError, \
("in 'ext_modules' option (extension '%s'), " +
"'sources' must be present and must be " +
--- 275,279 ----
sources = build_info.get ('sources')
if sources is None or type (sources) not in (ListType, TupleType):
! raise DistutilsSetupError, \
("in 'ext_modules' option (extension '%s'), " +
"'sources' must be present and must be " +
- Previous message: [Python-checkins] CVS: distutils/distutils cmd.py,1.5,1.6 dist.py,1.3,1.4 errors.py,1.5,1.6 msvccompiler.py,1.25,1.26 util.py,1.27,1.28
- Next message: [Python-checkins] CVS: distutils/distutils errors.py,1.6,1.7
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]