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

tenacity in requirements.txt should be updated. #113

Open
Mohaned2023 opened this issue Sep 14, 2024 · 1 comment
Open

tenacity in requirements.txt should be updated. #113

Mohaned2023 opened this issue Sep 14, 2024 · 1 comment

Comments

@Mohaned2023
Copy link

The tenacity should be >= 5.1.5
tenacity>=5.1.5

The old versions of tenacity used @asyncio.coroutine
and this causes an error:
AttributeError: module 'asyncio' has no attribute 'coroutine'

@OmarR5551
Copy link

OmarR5551 commented Oct 22, 2024

لحل المشكله:
1- حدث أحدث أصدار من مكتبة mega.py
2- حدث مكتبة tenacity الى أصدار 5.1.5
3- أحذف السطر الذي قبل الداله call
4- أدخل على ملف _asyncio.py وعدل الداله call الى هذا:

async def call(self, fn, *args, **kwargs):   # أستخدم هنا async
    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)   # أستخدم هنا await
            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)   # أستخدم هنا await
        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

2 participants