joanvila / aioredlock

:lock: The asyncio implemetation of Redis distributed locks
MIT License
295 stars 50 forks source link

"module 'aioredis' has no attribute 'errors'" #100

Closed vshulgin closed 2 years ago

vshulgin commented 2 years ago

Hello team,

I tried to use this lock implementation, and got problem "module 'aioredis' has no attribute 'errors'"

in the code

        except aioredis.errors.ReplyError as exc:  # script fault
            if exc.args[0].startswith('NOSCRIPT'):
                return await self.set_lock(resource, lock_identifier, lock_timeout, register_scripts=True)

from file aioredlock/redis.py

Indeed, I don't see errors module in aioredis, what I missed?

Versions:

aioredlock = "^0.7.2"
aioredis = "^2.0.0"
vshulgin commented 2 years ago

Well, I see, PR 99 is not yet merged, when we might to expect to get it done? Thanks

gtmanfred commented 2 years ago

aioredis implements its own version of its lock, so I am not inclined to make aioredlock support both aioredis < 2.0 and >= 2.0. I will update the requirements to just pin aioredis to < 2.0

gtmanfred commented 2 years ago

Closed in favor of #97