diff options
author | Eric Lin <anselor@gmail.com> | 2018-04-16 22:41:14 -0400 |
---|---|---|
committer | Eric Lin <anselor@gmail.com> | 2018-04-16 22:41:14 -0400 |
commit | d5d42fbc1ec809723eb353a5d1b1c4ead36e2bb1 (patch) | |
tree | 50464f94633ecc60a3c5580db113048d97fc8abf /AutoCompleter.py | |
parent | cd60899b13057f769686e9bf0df555955436592c (diff) | |
download | cmd2-git-d5d42fbc1ec809723eb353a5d1b1c4ead36e2bb1.tar.gz |
More changes for Python 3.4
Diffstat (limited to 'AutoCompleter.py')
-rwxr-xr-x | AutoCompleter.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/AutoCompleter.py b/AutoCompleter.py index e995284e..7ce29b0f 100755 --- a/AutoCompleter.py +++ b/AutoCompleter.py @@ -698,18 +698,22 @@ class ACArgumentParser(argparse.ArgumentParser): add_help=True, allow_abbrev=True): - super().__init__(prog=prog, - usage=usage, - description=description, - epilog=epilog, - parents=parents, - formatter_class=formatter_class, - prefix_chars=prefix_chars, - fromfile_prefix_chars=fromfile_prefix_chars, - argument_default=argument_default, - conflict_handler=conflict_handler, - add_help=add_help, - allow_abbrev=allow_abbrev) + params = {'prog': prog, + 'usage': usage, + 'description': description, + 'epilog': epilog, + 'parents': parents, + 'formatter_class': formatter_class, + 'prefix_chars': prefix_chars, + 'fromfile_prefix_chars': fromfile_prefix_chars, + 'argument_default': argument_default, + 'conflict_handler': conflict_handler, + 'add_help': add_help} + + if sys.version_info >= (3, 5): + params['allow_abbrev'] = allow_abbrev + + super().__init__(**params) register_custom_actions(self) self._custom_error_message = '' |