replace distutils for python 3.12

pull/3728/head
Branch Vincent 7 months ago
parent d0d0728523
commit a763fbbdfd
No known key found for this signature in database

@ -47,12 +47,9 @@ copyright = u'2014'
# #
from fail2ban.version import version as fail2ban_version from fail2ban.version import version as fail2ban_version
from distutils.version import LooseVersion
fail2ban_loose_version = LooseVersion(fail2ban_version)
# The short X.Y version. # The short X.Y version.
version = ".".join(str(_) for _ in fail2ban_loose_version.version[:2]) version = ".".join(str(_) for _ in fail2ban_version.split(".")[:2])
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = fail2ban_version release = fail2ban_version

@ -24,7 +24,6 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier, 2011-2012 Lee Clemens, 2012 Y
__license__ = "GPL" __license__ = "GPL"
import logging import logging
from distutils.version import LooseVersion
import os import os
from os.path import dirname, sep as pathsep from os.path import dirname, sep as pathsep
@ -38,7 +37,7 @@ from ..helpers import getLogger
if not hasattr(pyinotify, '__version__') \ if not hasattr(pyinotify, '__version__') \
or LooseVersion(pyinotify.__version__) < '0.8.3': # pragma: no cover or pyinotify.__version__.split(".") < '0.8.3'.split("."): # pragma: no cover
raise ImportError("Fail2Ban requires pyinotify >= 0.8.3") raise ImportError("Fail2Ban requires pyinotify >= 0.8.3")
# Verify that pyinotify is functional on this system # Verify that pyinotify is functional on this system

@ -24,10 +24,9 @@ __license__ = "GPL"
import os import os
import time import time
from distutils.version import LooseVersion
from systemd import journal from systemd import journal
if LooseVersion(getattr(journal, '__version__', "0")) < '204': if getattr(journal, "__version__", "0").split(".") < "204".split("."):
raise ImportError("Fail2Ban requires systemd >= 204") raise ImportError("Fail2Ban requires systemd >= 204")
from .failmanager import FailManagerEmpty from .failmanager import FailManagerEmpty

Loading…
Cancel
Save