MinoMino / minqlx

Extends Quake Live's dedicated server with extra functionality and scripting.
GNU General Public License v3.0
110 stars 42 forks source link

support for redis-py version 3 #114

Open em92 opened 1 year ago

em92 commented 1 year ago

As for now, at least official ban plugin is stuck at redis-py 2. Using redis-py 3 raises this exception: https://gist.github.com/lonewulfa/178842cc31276270548c5ad5060399c1

Breaking changes: https://github.com/redis/redis-py/blob/3a121bef7bbc5bb5f07b119b0eef2f7527a38eda/CHANGES#L539-L570

Probably good idea is adding compatibilty layer in minqlx itself.

mgaertne commented 1 year ago

Redis3 had an upgrade description: https://pypi.org/project/redis3/

Mainly this affects redis.zadd and redis.zincrby calls. Backward compability would be useful as well. I mainly solved this in existing plugins with:

        if redis.VERSION >= (3, ):
            # redis 3 calls
        else:
            # redis 2 calls