Merge 3.2 fix updates and tests for issue #15906.

This commit is contained in:
Barry Warsaw 2012-09-12 15:31:38 -04:00
commit d89774e158
2 changed files with 28 additions and 5 deletions

View file

@ -1961,7 +1961,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
# twice (which may fail) if the argument was given, but
# only if it was defined already in the namespace
if (action.default is not None and
isinstance(action, _StoreAction) and
isinstance(action.default, str) and
hasattr(namespace, action.dest) and
action.default is getattr(namespace, action.dest)):
setattr(namespace, action.dest,