summaryrefslogtreecommitdiff
path: root/redis/connection.py
diff options
context:
space:
mode:
authorKarthikeyan Singaravelan <tir.karthi@gmail.com>2021-08-29 13:49:45 +0530
committerGitHub <noreply@github.com>2021-08-29 11:19:45 +0300
commit8cfea4137851fa49c7d211b782800dd696b67c39 (patch)
tree92589b563cef92d1bf944ac5f590bbf8a8ab4d88 /redis/connection.py
parente19a76c58f2a998d86e51c5a2a0f1db37563efce (diff)
downloadredis-py-8cfea4137851fa49c7d211b782800dd696b67c39.tar.gz
Use Version instead of StrictVersion since distutils is deprecated. (#1552)
Diffstat (limited to 'redis/connection.py')
-rwxr-xr-xredis/connection.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/redis/connection.py b/redis/connection.py
index e47e3c7..de30f0c 100755
--- a/redis/connection.py
+++ b/redis/connection.py
@@ -1,4 +1,4 @@
-from distutils.version import StrictVersion
+from packaging.version import Version
from itertools import chain
from time import time
from queue import LifoQueue, Empty, Full
@@ -54,13 +54,13 @@ NONBLOCKING_EXCEPTIONS = tuple(NONBLOCKING_EXCEPTION_ERROR_NUMBERS.keys())
if HIREDIS_AVAILABLE:
import hiredis
- hiredis_version = StrictVersion(hiredis.__version__)
+ hiredis_version = Version(hiredis.__version__)
HIREDIS_SUPPORTS_CALLABLE_ERRORS = \
- hiredis_version >= StrictVersion('0.1.3')
+ hiredis_version >= Version('0.1.3')
HIREDIS_SUPPORTS_BYTE_BUFFER = \
- hiredis_version >= StrictVersion('0.1.4')
+ hiredis_version >= Version('0.1.4')
HIREDIS_SUPPORTS_ENCODING_ERRORS = \
- hiredis_version >= StrictVersion('1.0.0')
+ hiredis_version >= Version('1.0.0')
if not HIREDIS_SUPPORTS_BYTE_BUFFER:
msg = ("redis-py works best with hiredis >= 0.1.4. You're running "