Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
2.7 compatibility argparse
Browse files Browse the repository at this point in the history
  • Loading branch information
Axik committed May 12, 2016
1 parent 12281dc commit 512c929
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion datarobot_batch_scoring/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ def main(argv=sys.argv[1:]):
defaults.update(file_args)
parser.set_defaults(**defaults)
for action in parser._actions:
if action.dest in defaults:
if action.dest in defaults and action.required:
action.required = False
if '--' + action.dest not in argv:
action.nargs = '?'
parsed_args = {k: v
for k, v in vars(parser.parse_args(argv)).items()
if v is not None}
Expand Down

0 comments on commit 512c929

Please sign in to comment.