Skip to content

Commit 074f8f8

Browse files
authored
stubtest: minor cleanup now 3.6 is no longer supported (#13292)
1 parent 8919d2a commit 074f8f8

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

mypy/stubtest.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -302,12 +302,6 @@ def _belongs_to_runtime(r: types.ModuleType, attr: str) -> bool:
302302
yield from verify(stub_entry, runtime_entry, object_path + [entry])
303303

304304

305-
if sys.version_info >= (3, 7):
306-
_WrapperDescriptorType = types.WrapperDescriptorType
307-
else:
308-
_WrapperDescriptorType = type(object.__init__)
309-
310-
311305
@verify.register(nodes.TypeInfo)
312306
def verify_typeinfo(
313307
stub: nodes.TypeInfo, runtime: MaybeMissing[Type[Any]], object_path: List[str]
@@ -378,7 +372,7 @@ class SubClass(runtime): # type: ignore
378372
# The vast majority of these are false positives.
379373
if not (
380374
isinstance(stub_to_verify, Missing)
381-
and isinstance(runtime_attr, _WrapperDescriptorType)
375+
and isinstance(runtime_attr, types.WrapperDescriptorType)
382376
and is_dunder(mangled_entry, exclude_special=True)
383377
):
384378
yield from verify(stub_to_verify, runtime_attr, object_path + [entry])

mypy/test/teststubtest.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,8 +1195,6 @@ class _Options(TypedDict):
11951195

11961196
@collect_cases
11971197
def test_protocol(self) -> Iterator[Case]:
1198-
if sys.version_info < (3, 7):
1199-
return
12001198
yield Case(
12011199
stub="""
12021200
from typing_extensions import Protocol

0 commit comments

Comments
 (0)