From 61bd0b18822bec24fdd3a15cdaba040d65781384 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Wed, 15 Mar 2023 14:13:01 -0400 Subject: Remove a codepath meant for 3.7. (We no longer support it.) --- jsonschema/protocols.py | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'jsonschema') diff --git a/jsonschema/protocols.py b/jsonschema/protocols.py index 340b711..f324ea1 100644 --- a/jsonschema/protocols.py +++ b/jsonschema/protocols.py @@ -8,20 +8,14 @@ typing.Protocol classes for jsonschema interfaces. from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, ClassVar, Iterable -import sys - -# doing these imports with `try ... except ImportError` doesn't pass mypy -# checking because mypy sees `typing._SpecialForm` and -# `typing_extensions._SpecialForm` as incompatible -# -# see: -# https://mypy.readthedocs.io/en/stable/runtime_troubles.html#using-new-additions-to-the-typing-module -# https://github.com/python/mypy/issues/4427 -if sys.version_info >= (3, 8): - from typing import Protocol, runtime_checkable -else: - from typing_extensions import Protocol, runtime_checkable +from typing import ( + TYPE_CHECKING, + Any, + ClassVar, + Iterable, + Protocol, + runtime_checkable, +) # in order for Sphinx to resolve references accurately from type annotations, # it needs to see names like `jsonschema.TypeChecker` -- cgit v1.2.1