Skip to content
Discussion options

You must be logged in to vote

@francijb , can you share a bit more of the code? I have a feeling you are calling the await inside of a non-async function, but would be good to see the code around it to confirm.

As an example, this will cause the error you are seeing:

def my_func() {
  ...
  mm = MonarchMoney()
  await mm.login(user_name, pw) # This fails because an async keyword is being used inside a non-async function
}

If that's what's happening, you have two options:

  • convert the outer function to be async def my_func()
    • That will mean you need call it with await as well
    • This may not be possible, if you don't control the API of the outer function
  • instead of using await use the asyncio library functions to wrap i…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@francijb
Comment options

Answer selected by francijb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants