From 10252e88d5e3b372e4b12a68bc8a059ae4035cc8 Mon Sep 17 00:00:00 2001 From: Maxim S Date: Wed, 5 Jun 2024 14:20:48 +0200 Subject: [PATCH] Fix async call example Signed-off-by: Maxim S --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c89ef6a..b72c3d6 100644 --- a/README.md +++ b/README.md @@ -377,13 +377,13 @@ import asyncio import concurrent.futures from twocaptcha import TwoCaptcha -captcha_result = await captchaSolver(image) - async def captchaSolver(image): loop = asyncio.get_running_loop() - with concurrent.future.ThreadPoolExecutor() as pool: + with concurrent.futures.ThreadPoolExecutor() as pool: result = await loop.run_in_executor(pool, lambda: TwoCaptcha(API_KEY).normal(image)) return result + +captcha_result = asyncio.run(captchaSolver(image)) ```