Skip to content

Commit e0bfe51

Browse files
authored
cherry-pick(#1567): chore: mark pathAfterFinished return value optional (#1569)
1 parent e9c9a0e commit e0bfe51

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

playwright/_impl/_artifact.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ async def path_after_finished(self) -> Optional[pathlib.Path]:
3333
raise Error(
3434
"Path is not available when using browser_type.connect(). Use save_as() to save a local copy."
3535
)
36-
return pathlib.Path(await self._channel.send("pathAfterFinished"))
36+
path = await self._channel.send("pathAfterFinished")
37+
return pathlib.Path(path) if path else None
3738

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

0 commit comments

Comments
 (0)