summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey G. Brester <serg.brester@sebres.de>2023-05-03 12:00:24 +0200
committerGitHub <noreply@github.com>2023-05-03 12:00:24 +0200
commit5d9603c104fd50c6320d69dec394a28a452606f5 (patch)
treefc26970869cf1a361304ee40631517055c8c251d
parentbaf8330214f25efaec26a3e54bd1e8dcd25987d6 (diff)
downloadfail2ban-master.tar.gz
failregex.py: resolve deprecation warning for sre_constantsHEADmaster
closes gh-3508
-rw-r--r--fail2ban/server/failregex.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/fail2ban/server/failregex.py b/fail2ban/server/failregex.py
index a9b144af..7c3c139c 100644
--- a/fail2ban/server/failregex.py
+++ b/fail2ban/server/failregex.py
@@ -22,7 +22,6 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
import re
-import sre_constants
import sys
from .ipdns import IPAddr
@@ -157,7 +156,7 @@ class Regex:
self._tupleValues.sort()
self._altValues = self._altValues if len(self._altValues) else None
self._tupleValues = self._tupleValues if len(self._tupleValues) else None
- except sre_constants.error as e:
+ except re.error as e:
raise RegexException("Unable to compile regular expression '%s':\n%s" %
(regex, e))
# set fetch handler depending on presence of alternate (or tuple) tags: