Apply workaround for multiple short options for Python <= 3.8 (#5526)

Apply workaround for multiple short options for Python <= 3.8
This commit is contained in:
Bruno Oliveira 2019-06-29 12:33:00 -03:00 committed by GitHub
commit 497cd87fdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 3 deletions

View File

@ -55,10 +55,8 @@ jobs:
- env: TOXENV=py37-pluggymaster-xdist
- env: TOXENV=py37-freeze
# Jobs only run via Travis cron jobs (currently daily).
- env: TOXENV=py38-xdist
python: '3.8-dev'
if: type = cron
- stage: baseline
env: TOXENV=py36-xdist

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):