Skip to content

Commit

Permalink
stubtest: minor cleanup now 3.6 is no longer supported (#13292)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood authored Jul 30, 2022
1 parent 8919d2a commit 074f8f8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 1 addition & 7 deletions mypy/stubtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,6 @@ def _belongs_to_runtime(r: types.ModuleType, attr: str) -> bool:
yield from verify(stub_entry, runtime_entry, object_path + [entry])


if sys.version_info >= (3, 7):
_WrapperDescriptorType = types.WrapperDescriptorType
else:
_WrapperDescriptorType = type(object.__init__)


@verify.register(nodes.TypeInfo)
def verify_typeinfo(
stub: nodes.TypeInfo, runtime: MaybeMissing[Type[Any]], object_path: List[str]
Expand Down Expand Up @@ -378,7 +372,7 @@ class SubClass(runtime): # type: ignore
# The vast majority of these are false positives.
if not (
isinstance(stub_to_verify, Missing)
and isinstance(runtime_attr, _WrapperDescriptorType)
and isinstance(runtime_attr, types.WrapperDescriptorType)
and is_dunder(mangled_entry, exclude_special=True)
):
yield from verify(stub_to_verify, runtime_attr, object_path + [entry])
Expand Down
2 changes: 0 additions & 2 deletions mypy/test/teststubtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,6 @@ class _Options(TypedDict):

@collect_cases
def test_protocol(self) -> Iterator[Case]:
if sys.version_info < (3, 7):
return
yield Case(
stub="""
from typing_extensions import Protocol
Expand Down

0 comments on commit 074f8f8

Please sign in to comment.