From 6d7fecb2bf8a390b9a7f20af7d37401d7de1a2ff Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Tue, 27 Sep 2022 17:54:15 +0200 Subject: [PATCH] cherry-pick(#1567): chore: mark pathAfterFinished return value optional --- playwright/_impl/_artifact.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playwright/_impl/_artifact.py b/playwright/_impl/_artifact.py index ba71ac5dd..14202117e 100644 --- a/playwright/_impl/_artifact.py +++ b/playwright/_impl/_artifact.py @@ -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")))