Skip to content

Commit 5751f42

Browse files
sqwishygvanrossum
authored andcommitted
Let -2/--py2 argument destination match --python-version's (#5619)
Fixes #5576. This makes it so that there's no longer a difference between specifying `--python-version=2.7` and using `-2` or `--py2`. (The config file behaves different than any of those, but that's a separate issue.)
1 parent 3f2f102 commit 5751f42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def add_invertible_flag(flag: str,
465465
help='Type check code assuming it will be running on Python x.y',
466466
dest='special-opts:python_version')
467467
platform_group.add_argument(
468-
'-2', '--py2', dest='python_version', action='store_const',
468+
'-2', '--py2', dest='special-opts:python_version', action='store_const',
469469
const=defaults.PYTHON2_VERSION,
470470
help="Use Python 2 mode (same as --python-version 2.7)")
471471
platform_group.add_argument(

0 commit comments

Comments
 (0)