diff options
author | Greg Ward <gward@python.net> | 2000-09-27 00:15:37 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2000-09-27 00:15:37 (GMT) |
commit | 2c08cf0ffacdd450e24eeca1f58dfca571538449 (patch) | |
tree | a57acdcf43d0a1d86cb12fd119e75b88e3095df1 /Lib/distutils/dist.py | |
parent | 81467b814626e35cc988791ff29b818f67e4a148 (diff) | |
download | cpython-2c08cf0ffacdd450e24eeca1f58dfca571538449.zip cpython-2c08cf0ffacdd450e24eeca1f58dfca571538449.tar.gz cpython-2c08cf0ffacdd450e24eeca1f58dfca571538449.tar.bz2 |
Fix '_set_command_options()' so it only calls 'strtobool()' on strings
(was crashing on any boolean command-line option!).
Diffstat (limited to 'Lib/distutils/dist.py')
-rw-r--r-- | Lib/distutils/dist.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/distutils/dist.py b/Lib/distutils/dist.py index 91b820e..92d390f 100644 --- a/Lib/distutils/dist.py +++ b/Lib/distutils/dist.py @@ -755,9 +755,10 @@ class Distribution: 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) |