Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cherry-pick(#1567): chore: mark pathAfterFinished return value optional #1569

Merged
merged 1 commit into from Sep 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion playwright/_impl/_artifact.py
Expand Up @@ -33,7 +33,8 @@ async def path_after_finished(self) -> Optional[pathlib.Path]:
raise Error(
"Path is not available when using browser_type.connect(). Use save_as() to save a local copy."
)
return pathlib.Path(await self._channel.send("pathAfterFinished"))
path = await self._channel.send("pathAfterFinished")
return pathlib.Path(path) if path else None

async def save_as(self, path: Union[str, Path]) -> None:
stream = cast(Stream, from_channel(await self._channel.send("saveAsStream")))
Expand Down