Skip to content

Commit e9e9f77

Browse files
committed
Merge commit '98196a'
2 parents f38e051 + 98196a7 commit e9e9f77

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

importlib_metadata/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ def read_text(self, filename) -> Optional[str]:
388388
"""
389389

390390
@abc.abstractmethod
391-
def locate_file(self, path: os.PathLike[str]) -> SimplePath:
391+
def locate_file(self, path: str | os.PathLike[str]) -> SimplePath:
392392
"""
393393
Given a path to a file in this distribution, return a SimplePath
394394
to it.
@@ -433,7 +433,7 @@ def discover(
433433
)
434434

435435
@staticmethod
436-
def at(path: os.PathLike[str]) -> "Distribution":
436+
def at(path: str | os.PathLike[str]) -> "Distribution":
437437
"""Return a Distribution for the indicated metadata path.
438438
439439
:param path: a string or path-like object
@@ -841,7 +841,7 @@ def __init__(self, path: SimplePath) -> None:
841841
"""
842842
self._path = path
843843

844-
def read_text(self, filename: os.PathLike[str]) -> Optional[str]:
844+
def read_text(self, filename: str | os.PathLike[str]) -> Optional[str]:
845845
with suppress(
846846
FileNotFoundError,
847847
IsADirectoryError,
@@ -855,7 +855,7 @@ def read_text(self, filename: os.PathLike[str]) -> Optional[str]:
855855

856856
read_text.__doc__ = Distribution.read_text.__doc__
857857

858-
def locate_file(self, path: os.PathLike[str]) -> SimplePath:
858+
def locate_file(self, path: str | os.PathLike[str]) -> SimplePath:
859859
return self._path.parent / path
860860

861861
@property

newsfragments/+e563b690.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed type annotations to allow strings.

0 commit comments

Comments
 (0)