]> granicus.if.org Git - python/commit
Merge #12776,#11839: call argparse type function only once.
authorR David Murray <rdmurray@bitdance.com>
Sat, 1 Sep 2012 03:09:34 +0000 (23:09 -0400)
committerR David Murray <rdmurray@bitdance.com>
Sat, 1 Sep 2012 03:09:34 +0000 (23:09 -0400)
commit64b0ef15097017b20b1edca1d3bc1e38d51feb10
treee4a8291bea18c0642c011cfbccf1d6688304fa75
parent81378c8296f46c4bc36286438dfc66d48b047bf0
parent6fb8fb17bff87fdd5e738430502f34f8729766e3
Merge #12776,#11839: call argparse type function only once.

Before, the type function was called twice in the case where the default
was specified and the argument was given as well.  This was especially
problematic for the FileType type, as a default file would always be
opened, even if a file argument was specified on the command line.

Patch by Arnaud Fontaine, with additional test by Mike Meyer.
Lib/argparse.py
Lib/test/test_argparse.py
Misc/ACKS
Misc/NEWS