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: