Skip to content

Commit

Permalink
Remove reliance on typing-extensions, only required for Python 3.7 co…
Browse files Browse the repository at this point in the history
…mpatibility.
  • Loading branch information
jaraco committed Jul 7, 2023
1 parent b74d2b2 commit 97084d8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
9 changes: 1 addition & 8 deletions importlib_metadata/_compat.py
Expand Up @@ -5,14 +5,7 @@
from typing import Union


__all__ = ['install', 'NullFinder', 'Protocol']


try:
from typing import Protocol
except ImportError: # pragma: no cover
# Python 3.7 compatibility
from typing_extensions import Protocol # type: ignore
__all__ = ['install', 'NullFinder']


def install(cls):
Expand Down
2 changes: 1 addition & 1 deletion importlib_metadata/_meta.py
@@ -1,4 +1,4 @@
from ._compat import Protocol
from typing import Protocol
from typing import Any, Dict, Iterator, List, Optional, TypeVar, Union, overload


Expand Down
11 changes: 3 additions & 8 deletions tests/_path.py
@@ -1,14 +1,9 @@
# from jaraco.path 3.6
# from jaraco.path 3.7

import functools
import pathlib
from typing import Dict, Union

try:
from typing import Protocol, runtime_checkable
except ImportError: # pragma: no cover
# Python 3.7
from typing_extensions import Protocol, runtime_checkable # type: ignore
from typing import Dict, Protocol, Union
from typing import runtime_checkable


class Symlink(str):
Expand Down

0 comments on commit 97084d8

Please sign in to comment.