Skip to content

Commit

Permalink
Remove --py2 argument (#15670)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p authored Jul 14, 2023
1 parent a538cc9 commit 1958cb6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
2 changes: 0 additions & 2 deletions mypy/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import os
from typing import Final

PYTHON2_VERSION: Final = (2, 7)

# Earliest fully supported Python 3.x version. Used as the default Python
# version in tests. Mypy wheels should be built starting with this version,
# and CI tests should be run on this version (and later versions).
Expand Down
8 changes: 0 additions & 8 deletions mypy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,14 +594,6 @@ def add_invertible_flag(
help="Type check code assuming it will be running on Python x.y",
dest="special-opts:python_version",
)
platform_group.add_argument(
"-2",
"--py2",
dest="special-opts:python_version",
action="store_const",
const=defaults.PYTHON2_VERSION,
help="Use Python 2 mode (same as --python-version 2.7)",
)
platform_group.add_argument(
"--platform",
action="store",
Expand Down
2 changes: 1 addition & 1 deletion mypy/test/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def parse_options(
options.force_union_syntax = True

# Allow custom python version to override testfile_pyversion.
if all(flag.split("=")[0] not in ["--python-version", "-2", "--py2"] for flag in flag_list):
if all(flag.split("=")[0] != "--python-version" for flag in flag_list):
options.python_version = testfile_pyversion(testcase.file)

if testcase.config.getoption("--mypy-verbose"):
Expand Down

0 comments on commit 1958cb6

Please sign in to comment.