Skip to content

Commit 453c1ac

Browse files
committed
Do not store playwright object as instance attribute
1 parent 990b1ff commit 453c1ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scrapy_playwright/handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ async def _launch(self) -> None:
113113
"""Launch Playwright manager and configured startup context(s)."""
114114
logger.info("Starting download handler")
115115
self.playwright_context_manager = PlaywrightContextManager()
116-
self.playwright = await self.playwright_context_manager.start()
117-
self.browser_type: BrowserType = getattr(self.playwright, self.browser_type_name)
116+
playwright_instance = await self.playwright_context_manager.start()
117+
self.browser_type: BrowserType = getattr(playwright_instance, self.browser_type_name)
118118
if self.context_kwargs:
119119
logger.info("Launching %i startup context(s)", len(self.context_kwargs))
120120
await asyncio.gather(

0 commit comments

Comments
 (0)