From 5cb1b3c56fd70a23759aa3a1b33722160dda77fc Mon Sep 17 00:00:00 2001 From: Maddipatla Chatan Date: Sun, 11 Oct 2026 20:39:20 +0530 Subject: [PATCH] Replace time.sleep with asyncio.sleep for async calls --- contributing/samples/multimodal/computer_use/playwright.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contributing/samples/multimodal/computer_use/playwright.py b/contributing/samples/multimodal/computer_use/playwright.py index 9b61f5965de..4c9b2779069 100644 --- a/contributing/samples/multimodal/computer_use/playwright.py +++ b/contributing/samples/multimodal/computer_use/playwright.py @@ -313,7 +313,7 @@ async def current_state(self) -> ComputerState: await self._page.wait_for_load_state() # Even if Playwright reports the page as loaded, it may not be so. # Add a manual sleep to make sure the page has finished rendering. - time.sleep(0.5) + await asyncio.sleep(0.5) screenshot_bytes = await self._page.screenshot(type="png", full_page=False) return ComputerState(screenshot=screenshot_bytes, url=self._page.url) @@ -347,4 +347,4 @@ async def highlight_mouse(self, x: int, y: int): }} """) # Wait a bit for the user to see the cursor. - time.sleep(1) + await asyncio.sleep(1)