Skip to content

Commit

Permalink
Workaround for 3.12 distutils
Browse files Browse the repository at this point in the history
  • Loading branch information
coleifer committed Mar 22, 2024
1 parent bd6ace7 commit 79e20c8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions walrus/tests/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import os
import unittest
from distutils.version import StrictVersion
try:
from packaging.version import Version
except ImportError:
from distutils.version import StrictVersion as Version

from walrus import Database

Expand All @@ -19,7 +22,7 @@ def decorator(fn):
global REDIS_VERSION
if REDIS_VERSION is None:
REDIS_VERSION = db.info()['redis_version']
too_old = StrictVersion(REDIS_VERSION) < StrictVersion(min_version)
too_old = Version(REDIS_VERSION) < Version(min_version)
return unittest.skipIf(too_old,
'redis too old, requires %s' % min_version)(fn)
return decorator
Expand Down

0 comments on commit 79e20c8

Please sign in to comment.