Skip to content

Commit 97084d8

Browse files
committed
Remove reliance on typing-extensions, only required for Python 3.7 compatibility.
1 parent b74d2b2 commit 97084d8

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

importlib_metadata/_compat.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@
55
from typing import Union
66

77

8-
__all__ = ['install', 'NullFinder', 'Protocol']
9-
10-
11-
try:
12-
from typing import Protocol
13-
except ImportError: # pragma: no cover
14-
# Python 3.7 compatibility
15-
from typing_extensions import Protocol # type: ignore
8+
__all__ = ['install', 'NullFinder']
169

1710

1811
def install(cls):

importlib_metadata/_meta.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ._compat import Protocol
1+
from typing import Protocol
22
from typing import Any, Dict, Iterator, List, Optional, TypeVar, Union, overload
33

44

tests/_path.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
# from jaraco.path 3.6
1+
# from jaraco.path 3.7
22

33
import functools
44
import pathlib
5-
from typing import Dict, Union
6-
7-
try:
8-
from typing import Protocol, runtime_checkable
9-
except ImportError: # pragma: no cover
10-
# Python 3.7
11-
from typing_extensions import Protocol, runtime_checkable # type: ignore
5+
from typing import Dict, Protocol, Union
6+
from typing import runtime_checkable
127

138

149
class Symlink(str):

0 commit comments

Comments
 (0)