Skip to content

Commit

Permalink
Correct the startfile annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
SethMMorton committed Dec 23, 2024
1 parent 58c650e commit 26819d2
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions path/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1692,10 +1692,34 @@ def chroot(self) -> None: # pragma: nocover
os.chroot(self)

if sys.platform == "win32":
if sys.version_info >= (3, 10):

def startfile(self, operation: str | None = None) -> Self: # pragma: nocover
@overload
def startfile(
self,
arguments: str = ...,
cwd: str | None = ...,
show_cmd: int = ...,
) -> Self: ...
@overload
def startfile(
self,
operation: str,
arguments: str = ...,
cwd: str | None = ...,
show_cmd: int = ...,
) -> Self: ...

else:

@overload
def startfile(self) -> Self: ...
@overload
def startfile(self, operation: str) -> Self: ...

def startfile(self, *args, **kwargs) -> Self: # pragma: nocover
""".. seealso:: :func:`os.startfile`"""
os.startfile(self, operation=operation)
os.startfile(self, *args, **kwargs)
return self

# in-place re-writing, courtesy of Martijn Pieters
Expand Down

0 comments on commit 26819d2

Please sign in to comment.