Skip to content

Commit 5550ad8

Browse files
authored
fix playwright._impl._errors.TargetClosedError: Target page, context or browser has been closed on Windows (#259)
* fix playwright._impl._errors.TargetClosedError: Target page, context or browser has been closed * test on windows
1 parent aae7c6e commit 5550ad8

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
matrix:
1616
os:
1717
- ubuntu-latest
18-
# - windows-latest
18+
- windows-latest
1919
- macos-latest
2020
python-version:
2121
# - '3.8'

deepl/deepl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import os
34
import asyncio
45
from functools import partial
56
from typing import TYPE_CHECKING, Any, ClassVar
@@ -187,7 +188,7 @@ async def __get_browser(self, p: Playwright) -> Browser:
187188
headless=True,
188189
args=[
189190
"--no-sandbox",
190-
"--single-process",
191+
"--single-process" if os.name != "nt" else "",
191192
"--disable-dev-shm-usage",
192193
"--disable-gpu",
193194
"--no-zygote",

0 commit comments

Comments
 (0)