File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -2237,11 +2237,16 @@ def consume_positionals(start_index):
22372237 # twice (which may fail) if the argument was given, but
22382238 # only if it was defined already in the namespace
22392239 if (action .default is not None and
2240- isinstance (action .default , str ) and
22412240 hasattr (namespace , action .dest ) and
22422241 action .default is getattr (namespace , action .dest )):
2243- setattr (namespace , action .dest ,
2242+ if isinstance (action .default , str ):
2243+ setattr (namespace , action .dest ,
22442244 self ._get_value (action , action .default ))
2245+ elif (action .nargs not in (OPTIONAL , None ) and
2246+ isinstance (action .default , (list , tuple )) and
2247+ all (isinstance (v , str ) for v in action .default )):
2248+ setattr (namespace , action .dest ,
2249+ [self ._get_value (action , v ) for v in action .default ])
22452250
22462251 if required_actions :
22472252 raise ArgumentError (None , _ ('the following arguments are required: %s' ) %
You can’t perform that action at this time.
0 commit comments