Skip to content

Commit

Permalink
Remove some 3.6 legacy (#13349)
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored Aug 8, 2022
1 parent 6db26db commit cb50e63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
9 changes: 0 additions & 9 deletions mypy/typeops.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"""

import itertools
import sys
from typing import (
Any,
Dict,
Expand Down Expand Up @@ -857,14 +856,6 @@ class Status(Enum):
if name in ENUM_REMOVED_PROPS:
continue
new_items.append(LiteralType(name, typ))
# SymbolTables are really just dicts, and dicts are guaranteed to preserve
# insertion order only starting with Python 3.7. So, we sort these for older
# versions of Python to help make tests deterministic.
#
# We could probably skip the sort for Python 3.6 since people probably run mypy
# only using CPython, but we might as well for the sake of full correctness.
if sys.version_info < (3, 7):
new_items.sort(key=lambda lit: lit.value)
return make_simplified_union(new_items, contract_literals=False)
elif typ.type.fullname == "builtins.bool":
return make_simplified_union(
Expand Down
6 changes: 3 additions & 3 deletions mypy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,10 @@ def get_unique_redefinition_name(name: str, existing: Container[str]) -> str:
def check_python_version(program: str) -> None:
"""Report issues with the Python used to run mypy, dmypy, or stubgen"""
# Check for known bad Python versions.
if sys.version_info[:2] < (3, 6):
if sys.version_info[:2] < (3, 7):
sys.exit(
"Running {name} with Python 3.5 or lower is not supported; "
"please upgrade to 3.6 or newer".format(name=program)
"Running {name} with Python 3.6 or lower is not supported; "
"please upgrade to 3.7 or newer".format(name=program)
)


Expand Down

0 comments on commit cb50e63

Please sign in to comment.