diff options
author | Barry Warsaw <barry@python.org> | 2012-09-11 21:06:29 -0400 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2012-09-11 21:06:29 -0400 |
commit | 03fcfbef0aa9a0990d5cd3995defa8cd089f704c (patch) | |
tree | 056171792f9a71cc200050f7c8e90b9f68332d96 /Lib/argparse.py | |
parent | a8a5b397c1a30568be1309ed265b696da84eeca0 (diff) | |
download | cpython-git-03fcfbef0aa9a0990d5cd3995defa8cd089f704c.tar.gz |
- Issue #15906: Fix a regression in argparse caused by the preceding change,
when action='append', type='str' and default=[].
Diffstat (limited to 'Lib/argparse.py')
-rw-r--r-- | Lib/argparse.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/argparse.py b/Lib/argparse.py index ab8ff2faec..440d8faef6 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -1948,6 +1948,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 hasattr(namespace, action.dest) and action.default is getattr(namespace, action.dest)): setattr(namespace, action.dest, |