Skip to content

Commit 0351647

Browse files
committed
add playwright_path_env
1 parent 7b8dfca commit 0351647

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

PlaywrightSafeThread/browser/threadsafe_browser.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def __init__(
4040
check_open_dir=True,
4141
close_already_profile=True,
4242
loop=None,
43+
playwright_path_env=True,
4344
**kwargs
4445
) -> None:
4546
"""
@@ -243,9 +244,10 @@ def __init__(
243244
if key in __context_option:
244245
self._context_option.update({key: kwargs[key]})
245246

246-
os.environ.setdefault("PLAYWRIGHT_BROWSERS_PATH",
247-
kwargs.get("PLAYWRIGHT_BROWSERS_PATH") or self.PLAYWRIGHT_BROWSERS_PATH
248-
)
247+
if playwright_path_env:
248+
os.environ.setdefault("PLAYWRIGHT_BROWSERS_PATH",
249+
kwargs.get("PLAYWRIGHT_BROWSERS_PATH") or self.PLAYWRIGHT_BROWSERS_PATH
250+
)
249251

250252
# if install:
251253
# from PlaywrightSafeThread.browser.plawright_shim import run_playwright

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
long_description = open("README.md", encoding="utf-8").read()
55
description = "PlaywrightSafeThread"
66

7-
version = "0.5.3"
7+
version = "0.5.3.1"
88

99
setup(
1010
name="PlaywrightSafeThread",

0 commit comments

Comments
 (0)