Skip to content

Commit 4b2aff9

Browse files
committed
_meta: fix SimplePath protocol
Signed-off-by: Filipe Laíns <lains@riseup.net>
1 parent 15df009 commit 4b2aff9

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

‎importlib_metadata/_meta.py‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import os
2+
13
from ._compat import Protocol
2-
from typing import Any, Dict, Iterator, List, TypeVar, Union
4+
from typing import Any, Dict, Iterator, List, Optional, TypeVar, Union
35

46

57
_T = TypeVar("_T")
@@ -35,14 +37,17 @@ class SimplePath(Protocol):
3537
A minimal subset of pathlib.Path required by PathDistribution.
3638
"""
3739

38-
def joinpath(self) -> 'SimplePath':
40+
def joinpath(self, *other: Union[str, 'os.PathLike[str]']) -> 'SimplePath':
3941
... # pragma: no cover
4042

41-
def __truediv__(self) -> 'SimplePath':
43+
def __truediv__(self, other: Union[str, 'os.PathLike[str]']) -> 'SimplePath':
4244
... # pragma: no cover
4345

46+
@property
4447
def parent(self) -> 'SimplePath':
4548
... # pragma: no cover
4649

47-
def read_text(self) -> str:
50+
def read_text(
51+
self, encoding: Optional[str] = None, errors: Optional[str] = None
52+
) -> str:
4853
... # pragma: no cover

0 commit comments

Comments
 (0)