Skip to content

Commit

Permalink
cherry-pick(microsoft#1567): chore: mark pathAfterFinished return val…
Browse files Browse the repository at this point in the history
…ue optional
  • Loading branch information
mxschmitt authored and rwoll committed Sep 27, 2022
1 parent e9c9a0e commit 6d7fecb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion playwright/_impl/_artifact.py
Original file line number Diff line number Diff line change
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

0 comments on commit 6d7fecb

Please sign in to comment.