Skip to content

Commit

Permalink
failregex.py: resolve deprecation warning for sre_constants
Browse files Browse the repository at this point in the history
closes gh-3508
  • Loading branch information
sebres committed May 3, 2023
1 parent baf8330 commit 5d9603c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fail2ban/server/failregex.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
__license__ = "GPL"

import re
import sre_constants
import sys

from .ipdns import IPAddr
Expand Down Expand Up @@ -157,7 +156,7 @@ def __init__(self, regex, multiline=False, **kwargs):
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:
Expand Down

0 comments on commit 5d9603c

Please sign in to comment.