Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

browser.py code cleanup

ajuijasc3c89c3176bc
diff --git a/browser_use/browser/browser.py b/browser_use/browser/browser.py
index f7b411b08..cdd18fb91 100644
--- a/browser_use/browser/browser.py
+++ b/browser_use/browser/browser.py
@@ -398,8 +398,6 @@ class Browser:
except Exception as e:
logger.debug(f'Failed to terminate chrome subprocess: {e}')
- # Then cleanup httpx clients
- await self.cleanup_httpx_clients()
except Exception as e:
if 'OpenAI error' not in str(e):
logger.debug(f'Failed to close browser properly: {e}')
@@ -422,6 +420,3 @@ class Browser:
except Exception as e:
logger.debug(f'Failed to cleanup browser in destructor: {e}')
- async def cleanup_httpx_clients(self):
- """No-op method - browser instances shouldn't close httpx clients they didn't create."""
- pass