diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-03-11 05:59:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-03-11 05:59:22 +0000 |
commit | 770359ab1b5d6d8421ee93ca9fdc7d044e0a1c78 (patch) | |
tree | cef8737b15ced6cfadaa45b0d758a3c0cf764da1 /iredis/client.py | |
parent | Releasing progress-linux version 1.11.0-1. (diff) | |
download | iredis-770359ab1b5d6d8421ee93ca9fdc7d044e0a1c78.tar.xz iredis-770359ab1b5d6d8421ee93ca9fdc7d044e0a1c78.zip |
Merging upstream version 1.11.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'iredis/client.py')
-rw-r--r-- | iredis/client.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/iredis/client.py b/iredis/client.py index a5295fb..29045da 100644 --- a/iredis/client.py +++ b/iredis/client.py @@ -7,7 +7,7 @@ import sys import logging from subprocess import run from importlib_resources import read_text -from distutils.version import StrictVersion +from packaging.version import parse as version_parse import redis from prompt_toolkit.shortcuts import clear @@ -156,9 +156,11 @@ class Client: return connection_class(**connection_kwargs) def auth_compat(self, redis_version: str): - with_username = StrictVersion(redis_version) >= StrictVersion("6.0.0") + with_username = version_parse(redis_version) >= version_parse("6.0.0") if with_username: command2syntax["AUTH"] = "command_usernamex_password" + else: + command2syntax["AUTH"] = "command_password" def set_default_pager(self, config): configured_pager = config.pager @@ -532,7 +534,7 @@ class Client: # FIXME anything strange with single quotes? logger.debug(f"[--version--] '{server_version}'") try: - is_available = StrictVersion(server_version) > StrictVersion( + is_available = version_parse(server_version) > version_parse( available_version ) except Exception as e: @@ -670,7 +672,7 @@ class Client: # use `memory usage` to get memory, this command available from redis4.0 mem = "" - if config.version and StrictVersion(config.version) >= StrictVersion("4.0.0"): + if config.version and version_parse(config.version) >= version_parse("4.0.0"): memory_usage_value = str(self.execute("memory usage", key)) mem = f" mem: {memory_usage_value} bytes" |