[Python-checkins] CVS: distutils/distutils dist.py,1.16,1.17
Greg Ward
python-dev@python.org
Mon, 22 May 2000 21:11:17 -0700
Update of /cvsroot/python/distutils/distutils
In directory slayer.i.sourceforge.net:/tmp/cvs-serv19210
Modified Files:
dist.py
Log Message:
Fix 'get_command_obj()' so it checks if a command object has an attribute
before setting it -- this will catch bad options (eg. typos) in config files.
Index: dist.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/dist.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** dist.py 2000/05/23 03:47:35 1.16
--- dist.py 2000/05/23 04:11:14 1.17
***************
*** 7,11 ****
# (extricated from core.py; actually dates back to the beginning)
! __revision__ = "$Id: dist.py,v 1.16 2000/05/23 03:47:35 gward Exp $"
import sys, os, string, re
--- 7,11 ----
# (extricated from core.py; actually dates back to the beginning)
! __revision__ = "$Id: dist.py,v 1.17 2000/05/23 04:11:14 gward Exp $"
import sys, os, string, re
***************
*** 628,631 ****
--- 628,635 ----
for (option, (source, value)) in options.items():
print " %s = %s (from %s)" % (option, value, source)
+ if not hasattr(cmd_obj, option):
+ raise DistutilsOptionError, \
+ ("%s: command '%s' has no such option '%s'") % \
+ (source, command, option)
setattr(cmd_obj, option, value)