Skip to content

Commit 9ce8416

Browse files
committed
fix: Use Path.write_bytes() to avoid SYNC230 lint error
1 parent 3336b9d commit 9ce8416

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

browser_use/browser/session.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2304,9 +2304,7 @@ async def take_screenshot(self, path: str | None = None, full_page: bool = False
23042304

23052305
screenshot_data = base64.b64decode(result['data'])
23062306

2307-
if path:
2308-
with open(path, 'wb') as f:
2309-
f.write(screenshot_data)
2307+
if path: Path(path).write_bytes(screenshot_data)
23102308

23112309
return screenshot_data
23122310

0 commit comments

Comments
 (0)