Apply workaround for multiple short options for Python <= 3.8

Hopefully by Python 3.9 this will be fixed upstream, if not we will
need to bump the version again.

Fix #5523
This commit is contained in:
Bruno Oliveira 2019-06-29 11:13:24 -03:00 committed by Miro Hrončok
parent 4f9bf028f5
commit 1db132290f
2 changed files with 2 additions and 1 deletions

View File

@ -0,0 +1 @@
Fixed using multiple short options together in the command-line (for example ``-vs``) in Python 3.8+.

View File

@ -358,7 +358,7 @@ class MyOptionParser(argparse.ArgumentParser):
getattr(args, FILE_OR_DIR).extend(argv)
return args
if sys.version_info[:2] < (3, 8): # pragma: no cover
if sys.version_info[:2] < (3, 9): # pragma: no cover
# Backport of https://github.com/python/cpython/pull/14316 so we can
# disable long --argument abbreviations without breaking short flags.
def _parse_optional(self, arg_string):