From fe6671b0ae46f9f0d5b6db9acfc9ed624ccbd48a Mon Sep 17 00:00:00 2001 From: eggplants Date: Tue, 30 Apr 2024 11:25:48 +0900 Subject: [PATCH] add deps installation --- deepl/deepl.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deepl/deepl.py b/deepl/deepl.py index 8718cb1..8ac4f99 100644 --- a/deepl/deepl.py +++ b/deepl/deepl.py @@ -1,6 +1,7 @@ from __future__ import annotations import asyncio +from functools import partial from typing import TYPE_CHECKING, Any, ClassVar from urllib.parse import quote @@ -98,6 +99,7 @@ async def __translate(self, script: str) -> str: except PlaywrightError as e: if "playwright install" in e.message: print("Installing browser executable. This may take some time.") # noqa: T201 + await asyncio.get_event_loop().run_in_executor(None, partial(install, p.chromium, with_deps=True)) await asyncio.get_event_loop().run_in_executor(None, install, p.chromium) browser = await self.__get_browser(p) else: