[Python-checkins] CVS: distutils/distutils dist.py,1.39,1.40

Greg Ward python-dev@python.org
Tue, 26 Sep 2000 17:15:41 -0700


Update of /cvsroot/python/distutils/distutils
In directory slayer.i.sourceforge.net:/tmp/cvs-serv2201

Modified Files:
	dist.py 
Log Message:
Fix '_set_command_options()' so it only calls 'strtobool()' on strings
(was crashing on any boolean command-line option!).

Index: dist.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/dist.py,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -r1.39 -r1.40
*** dist.py	2000/09/26 01:52:25	1.39
--- dist.py	2000/09/27 00:15:37	1.40
***************
*** 756,762 ****
  
              try:
!                 if neg_opt.has_key(option):
                      setattr(command_obj, neg_opt[option], not strtobool(value))
!                 elif option in bool_opts:
                      setattr(command_obj, option, strtobool(value))
                  elif hasattr(command_obj, option):
--- 756,763 ----
  
              try:
!                 is_string = type(value) is StringType
!                 if neg_opt.has_key(option) and is_string:
                      setattr(command_obj, neg_opt[option], not strtobool(value))
!                 elif option in bool_opts and is_string:
                      setattr(command_obj, option, strtobool(value))
                  elif hasattr(command_obj, option):