Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python 3.9 object NoneType can't be used in 'await' expression #51

Open
simbadmorehod opened this issue Dec 18, 2021 · 0 comments
Open

Comments

@simbadmorehod
Copy link

simbadmorehod commented Dec 18, 2021

I am new to programming, so please take this into account

Traceback:
Google_translator.py", line 6, in translator
text = await g.translate(f"{text}", locale)
File "C:\Python39\lib\site-packages\async_google_trans_new\main.py", line 241, in translate
await s.close()
TypeError: object NoneType can't be used in 'await' expression

code:
**
from aiogram.types.base import String
import async_google_trans_new

async def translator(text: String, locale: String):
g = async_google_trans_new.AsyncTranslator()
text = await g.translate(f"{text}", locale)
return text
**

I use a library function call from the asynchronous code of the telegram bot, need translation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant