summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2023-03-15 14:13:01 -0400
committerJulian Berman <Julian@GrayVines.com>2023-03-15 14:13:01 -0400
commit61bd0b18822bec24fdd3a15cdaba040d65781384 (patch)
tree914d0dbb44b3cbae63f2b2fb0af8042caee4e4a5
parent69fc7b4eaf5ab622ac9cb7a20cd1039f0620184d (diff)
downloadjsonschema-61bd0b18822bec24fdd3a15cdaba040d65781384.tar.gz
Remove a codepath meant for 3.7.
(We no longer support it.)
-rw-r--r--jsonschema/protocols.py22
1 files changed, 8 insertions, 14 deletions
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`