Skip to content

Commit

Permalink
removed user data dir
Browse files Browse the repository at this point in the history
  • Loading branch information
kunwar-reworkd committed Dec 18, 2024
1 parent 819216b commit 018819f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sdk/harambe/contrib/playwright/harness.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import shutil
import tempfile

from collections import defaultdict
from contextlib import asynccontextmanager
from typing import Any, AsyncGenerator, Awaitable, Callable, Optional, Sequence, cast
Expand Down Expand Up @@ -51,7 +52,6 @@ async def playwright_harness(
"""
async with async_playwright() as p:
extension_args = []
user_data_dir = tempfile.mkdtemp()
browser_type = browser_type or "chromium"

if extensions and browser_type == "chromium":
Expand Down Expand Up @@ -151,5 +151,4 @@ async def page_factory(*_: Any, **__: Any) -> PlaywrightPage:
await on_end(ctx)
finally:
await ctx.close()
await browser.close()
shutil.rmtree(user_data_dir, ignore_errors=True)
await browser.close()

0 comments on commit 018819f

Please sign in to comment.