Browse Source

replace distutils for python 3.12

pull/3728/head
Branch Vincent 7 months ago
parent
commit
a763fbbdfd
No known key found for this signature in database
  1. 5
      doc/conf.py
  2. 3
      fail2ban/server/filterpyinotify.py
  3. 3
      fail2ban/server/filtersystemd.py

5
doc/conf.py

@ -47,12 +47,9 @@ copyright = u'2014'
#
from fail2ban.version import version as fail2ban_version
from distutils.version import LooseVersion
fail2ban_loose_version = LooseVersion(fail2ban_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.
release = fail2ban_version

3
fail2ban/server/filterpyinotify.py

@ -24,7 +24,6 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier, 2011-2012 Lee Clemens, 2012 Y
__license__ = "GPL"
import logging
from distutils.version import LooseVersion
import os
from os.path import dirname, sep as pathsep
@ -38,7 +37,7 @@ from ..helpers import getLogger
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")
# Verify that pyinotify is functional on this system

3
fail2ban/server/filtersystemd.py

@ -24,10 +24,9 @@ __license__ = "GPL"
import os
import time
from distutils.version import LooseVersion
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")
from .failmanager import FailManagerEmpty

Loading…
Cancel
Save