diff --git a/Lib/distutils/dist.py b/Lib/distutils/dist.py index 91b820e9b4bd..92d390f777c1 100644 --- a/Lib/distutils/dist.py +++ b/Lib/distutils/dist.py @@ -755,9 +755,10 @@ def _set_command_options (self, command_obj, option_dict=None): neg_opt = {} try: - if neg_opt.has_key(option): + 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: + elif option in bool_opts and is_string: setattr(command_obj, option, strtobool(value)) elif hasattr(command_obj, option): setattr(command_obj, option, value)