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

Solve the problem of @asyncio.coroutine #116

Open
OmarR5551 opened this issue Oct 22, 2024 · 0 comments
Open

Solve the problem of @asyncio.coroutine #116

OmarR5551 opened this issue Oct 22, 2024 · 0 comments

Comments

@OmarR5551
Copy link

OmarR5551 commented Oct 22, 2024

To solve the problem:

1- Update the mega.py library to the latest version.
2- Downgrade the tenacity library to version 5.1.5.
3- Remove the line before the call function.
4- Go to the _asyncio.py file and modify the call function to the following:

async def call(self, fn, *args, **kwargs):   # Use async here
    self.begin(fn)

    retry_state = RetryCallState(
        retry_object=self, fn=fn, args=args, kwargs=kwargs)
    while True:
        do = self.iter(retry_state=retry_state)
        if isinstance(do, DoAttempt):
            try:
                result = await fn(*args, **kwargs)   # Use await here
            except BaseException:
                retry_state.set_exception(sys.exc_info())
            else:
                retry_state.set_result(result)
        elif isinstance(do, DoSleep):
            retry_state.prepare_for_next_attempt()
            await self.sleep(do)   # Use await here
        else:
            return do
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