Skip to content

Commit 10252e8

Browse files
committed
Fix async call example
Signed-off-by: Maxim S <[email protected]>
1 parent aaa3e6a commit 10252e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,13 +377,13 @@ import asyncio
377377
import concurrent.futures
378378
from twocaptcha import TwoCaptcha
379379

380-
captcha_result = await captchaSolver(image)
381-
382380
async def captchaSolver(image):
383381
loop = asyncio.get_running_loop()
384-
with concurrent.future.ThreadPoolExecutor() as pool:
382+
with concurrent.futures.ThreadPoolExecutor() as pool:
385383
result = await loop.run_in_executor(pool, lambda: TwoCaptcha(API_KEY).normal(image))
386384
return result
385+
386+
captcha_result = asyncio.run(captchaSolver(image))
387387
```
388388

389389

0 commit comments

Comments
 (0)